No description
|
||
---|---|---|
.github/workflows | ||
src | ||
.gitattributes | ||
.gitignore | ||
build.zig | ||
LICENSE | ||
README.md | ||
test.sh | ||
zig.mod | ||
zigmod.lock |
skip
Skip part of a file.
As head
will show the top of a file after a number of line,
so skip
will do the opposite, and not show the top of the file,
but will show the rest.
Additionally, it can check for whole lines matching, or for a token being present on the line.
Usage
Skip a fixed number of lines
This example reads the file from stdin.
File: input.txt
line 1
line 2
line 3
line 4
skip 2 < input.txt
Will output:
line 3
line 4
Skip until a number of matching lines
This example reads the named file.
File: input.txt
alpha
beta
alpha
alpha
gamma
alpha
skip 2 --line alpha input.txt
Will output:
alpha
gamma
alpha
Skip lines until a number of tokens as seen
This example reads the file from stdin.
File: input.txt
Lorem ipsum dolor sit amet,
consectetur adipiscing elit,
sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua.
Ut enim ad minim veniam,
quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea
commodo consequat.
cat input.txt | skip 2 --token dolor
Will output:
Ut enim ad minim veniam,
quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea
commodo consequat.
It matches the first dolor
on line 1,
and the second on line 4 as part of the word dolore
.