Make gene a powerful language for text processing
Opened this issue · 0 comments
gcao commented
This should not break in future versions
but should not introduce unsound design either
-
Read input from pipeline
-
Take a flag to treat input as new-line-separated string or gene data
-
Take a flag to output as new-line-separated string or gene data
-
Make it easy to write one-liner to process text
Flags:
- e, eval: code to evaluate
- im, input_mode: if set to "line", program will iterate thru all lines
if set to "gene", input will be parsed into stream of Gene values, and program will iterate thru all values
if set to "csv", csv parser will be used to parse input stream - line: same as --input_mode line
- csv: same as --input_mode csv
- gene: same as --input_mode gene
- tr, trim: default to false (trim white spaces)
- tb, trim_beginning: default to false (trim white spaces at the beginning)
- te, trim_end: default to false (trim white spaces at the end)
- sf, skip_first_line: default to false
- se, skip_empty_line: default to true
- fs, field_sep: "comma", "tab", "space", "colon" etc, if not specified, the value variable contains whole line as is
- in, index_name: the row index variable name, default to "i"
- vn, value_name: the row value variable name, default to "v"
- pr, print_result: print result automatically with new line appended
- fr, filter_result: do not print result if false
- code, code1, ...: replace #<CODE/>#, #<CODE>#...#</CODE># etc with code from command line.