wilsonfreitas / csvgrep

Easy and funny searches on text delimited files
http://wilsonfreitas.github.io/csvgrep
MIT License
5 stars 1 forks source link

Include a special variable which refers to the last column #1

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
csvgrep needs a special variable to identify the last column the same way _end_ 
in MATLAB

A good approach is to use $NF (number of fields special variable) to index the 
last field.
Here it follows a few possibilities:

1. csvgrep '${$NF} eq "Doe$"' # Variables inside curly braces
2. csvgrep '${NF} eq "Doe$"' # Identifier inside curly braces. It conflicts 
with a column named NF
3. csvgrep '${-1} eq "Doe$"' # Python indexing approach
4. csvgrep '${end} eq "Doe$"' # MATLAB indexing approach
5. csvgrep '${$end} eq "Doe$"' # MATLAB indexing approach
6. csvgrep '$end eq "Doe$"' # MATLAB indexing approach

Original issue reported on code.google.com by wilson.freitas on 9 Jul 2012 at 5:54

GoogleCodeExporter commented 9 years ago

Original comment by wilson.freitas on 10 Jul 2012 at 1:01