https://github.com/amandasaurus/fromto-printer-py
Selectively print lines from a input if it's between lines that match a regex
https://github.com/amandasaurus/fromto-printer-py
Last synced: 4 months ago
JSON representation
Selectively print lines from a input if it's between lines that match a regex
- Host: GitHub
- URL: https://github.com/amandasaurus/fromto-printer-py
- Owner: amandasaurus
- License: gpl-3.0
- Created: 2015-04-28T13:35:58.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2015-04-28T13:36:19.000Z (about 10 years ago)
- Last Synced: 2024-12-27T00:24:40.603Z (6 months ago)
- Language: Python
- Size: 109 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Reads in input lines from stdin, and prints out a subset of them, based on lines that match the start and end.
Traditional unix utilities (like grep) can print lines that match a regex, or treat each line as separate, handling no state.
Usage:
usage: fromto [-h] [-f REGEX] [-F REGEX] [-t REGEX] [-T REGEX]
optional arguments:
-h, --help show this help message and exitFrom regex:
Start printing lines 'from' this line. Must not use both together.-f REGEX, --from-incl REGEX
Start 'from' this line, and print this line
-F REGEX, --from-excl REGEX
Start 'from' this line, and don't print this lineTo regex:
Stop printing line when you get 'to' a line that matches this. Must not
use both together-t REGEX, --to-incl REGEX
Continue printing 'to' this line, and do print this
line
-T REGEX, --to-excl REGEX
Continue printing 'to' this line, and don't print this
line