https://github.com/orangesi/grepfile
a alternative for $grep -f A.list B.list which cost too many memory and time
https://github.com/orangesi/grepfile
crystal-lang grep-like regex ruby
Last synced: 9 months ago
JSON representation
a alternative for $grep -f A.list B.list which cost too many memory and time
- Host: GitHub
- URL: https://github.com/orangesi/grepfile
- Owner: orangeSi
- Created: 2019-08-24T00:31:20.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2021-09-09T03:05:23.000Z (almost 5 years ago)
- Last Synced: 2024-11-19T13:07:38.617Z (over 1 year ago)
- Topics: crystal-lang, grep-like, regex, ruby
- Language: Crystal
- Homepage:
- Size: 10.5 MB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# grepfile
a alternative for $grep -f A.list B.list which cost too many memory and time
### usage:
```
$ cat t.list
@ddd
>B1
A1
$ cat q.list
#xx
>A1
>ddd
A2
>B
$ ./grepfile t.list q.list
A1
$cat t.list|./grepfile - q.list
A1
$cat q.list|./grepfile t.list -
A1
$./grepfile t.list q.list --exact-match 0
>B1
A1
$ ldd grepfile
not a dynamic executable
```
### Install:
```
directyly use grepfile binary executable file in Linux or complie grepfile.cr with crystal lang(v1.0.0)
```
### document
```
ontact: https://github.com/orangeSi/grepfile/issues
Usage:
./grepfile [flags...] [arg...]
A replace for $ grep -f (which cost too many memory and time) in Linux
Flags:
--column-query (default: 1) # choose which column to compare
--column-target (default: 1) # choose which column to compare
--delete-chars-from-column (default: "^>") # delete > from content of column, support regex syntax
--exact-match (default: 1) # if >=1, mean equal totally else mean macth
--help # Displays help for the current command.
--ignore-case (default: 0) # if set to 1 mean will ignore case for query and target match, default 0
--ignore-line-mathed-by (default: "^[#@]") # if content of column start with # or @, will skip this line, support regex syntax
--invert-match (default: 0) # if >=1, mean invert the sense of matching, to select non-matching lines
--sep-query (default: "\t") # query separator, '\t' or '\s' or other string
--sep-target (default: "\t") # target separator, '\t' or '\s' or other string
--sort-output-by-query (default: 0) # sort ouput by query column order
--version # Displays the version of the current application.
Arguments:
target (required) # target file, support flat or .gz file or stdin(by -)
query (required) # query file, support flat or .gz file or stdin(by -)
```