mirror of
https://codeberg.org/scip/tablizer.git
synced 2025-12-17 04:30:56 +01:00
Merge branch 'main' into feature/yank
This commit is contained in:
54
tablizer.pod
54
tablizer.pod
@@ -5,7 +5,7 @@ tablizer - Manipulate tabular output of other programs
|
||||
=head1 SYNOPSIS
|
||||
|
||||
Usage:
|
||||
tablizer [regex] [file, ...] [flags]
|
||||
tablizer [regex,...] [file, ...] [flags]
|
||||
|
||||
Operational Flags:
|
||||
-c, --columns string Only show the speficied columns (separated by ,)
|
||||
@@ -16,7 +16,7 @@ tablizer - Manipulate tabular output of other programs
|
||||
-s, --separator string Custom field separator
|
||||
-k, --sort-by int|name Sort by column (default: 1)
|
||||
-z, --fuzzy Use fuzzy search [experimental]
|
||||
-F, --filter field=reg Filter given field with regex, can be used multiple times
|
||||
-F, --filter field[!]=reg Filter given field with regex, can be used multiple times
|
||||
-T, --transpose-columns string Transpose the speficied columns (separated by ,)
|
||||
-R, --regex-transposer /from/to/ Apply /search/replace/ regexp to fields given in -T
|
||||
|
||||
@@ -144,32 +144,44 @@ useful for the developer.
|
||||
|
||||
=head2 PATTERNS AND FILTERING
|
||||
|
||||
You can reduce the rows being displayed by using a regular expression
|
||||
pattern. The regexp is PCRE compatible, refer to the syntax cheat
|
||||
sheet here: L<https://github.com/google/re2/wiki/Syntax>. If you want
|
||||
to read a more comprehensive documentation about the topic and have
|
||||
perl installed you can read it with:
|
||||
You can reduce the rows being displayed by using one or more regular
|
||||
expression patterns. The regexp language being used is the one of
|
||||
GOLANG, refer to the syntax cheat sheet here:
|
||||
L<https://pkg.go.dev/regexp/syntax>.
|
||||
|
||||
If you want to read a more comprehensive documentation about the
|
||||
topic and have perl installed you can read it with:
|
||||
|
||||
perldoc perlre
|
||||
|
||||
Or read it online: L<https://perldoc.perl.org/perlre>.
|
||||
Or read it online: L<https://perldoc.perl.org/perlre>. But please note
|
||||
that the GO regexp engine does NOT support all perl regex terms,
|
||||
especially look-ahead and look-behind.
|
||||
|
||||
A note on modifiers: the regexp engine used in tablizer uses another
|
||||
modifier syntax:
|
||||
If you want to supply flags to a regex, then surround it with slashes
|
||||
and append the flag. The following flags are supported:
|
||||
|
||||
(?MODIFIER)
|
||||
|
||||
The most important modifiers are:
|
||||
|
||||
C<i> ignore case
|
||||
C<m> multiline mode
|
||||
C<s> single line mode
|
||||
i => case insensitive
|
||||
! => negative match
|
||||
|
||||
Example for a case insensitive search:
|
||||
|
||||
kubectl get pods -A | tablizer "(?i)account"
|
||||
kubectl get pods -A | tablizer "/account/i"
|
||||
|
||||
You can use the experimental fuzzy search feature by providing the
|
||||
If you use the C<!> flag, then the regex match will be negated, that
|
||||
is, if a line in the input matches the given regex, but C<!> is
|
||||
supplied, tablizer will NOT include it in the output.
|
||||
|
||||
For example, here we want to get all lines matching "foo" but not
|
||||
"bar":
|
||||
|
||||
cat table | tablizer foo '/bar/!'
|
||||
|
||||
This would match a line "foo zorro" but not "foo bar".
|
||||
|
||||
The flags can also be combined.
|
||||
|
||||
You can also use the experimental fuzzy search feature by providing the
|
||||
option B<-z>, in which case the pattern is regarded as a fuzzy search
|
||||
term, not a regexp.
|
||||
|
||||
@@ -184,6 +196,10 @@ Fieldnames (== columns headers) are case insensitive.
|
||||
If you specify more than one filter, both filters have to match (AND
|
||||
operation).
|
||||
|
||||
These field filters can also be negated:
|
||||
|
||||
fieldname!=regexp
|
||||
|
||||
If the option B<-v> is specified, the filtering is inverted.
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user