datopian / datapipes

Data Pipes for CSV
https://datapipes.okfnlabs.org/
MIT License
117 stars 16 forks source link

Transform: grep (row filter) #31

Open rufuspollock opened 11 years ago

rufuspollock commented 11 years ago

Basic question: do we match unix grep as much as possible?

See also

rufuspollock commented 11 years ago

Start on this in PR #28

rufuspollock commented 11 years ago

@davidmiller interested in your thoughts on following unix grep (vs e.g. csvgrep). For example, -i for invert versus -v ...

davidmiller commented 11 years ago

+10 for following unix grep flags.

andylolz commented 10 years ago

Is this the time to introduce a javascript optparse library? Parsing options for the operations so far has been fine without one, but grep is a bit trickier, and I guess npm is bound to have a good option parser.

rufuspollock commented 10 years ago

@andylolz I thought that may be a good idea :-) (plus will sync with #19 and #18)

andylolz commented 10 years ago

node-optimist looks like a very popular choice.

andylolz commented 10 years ago

A few more of these options are in now (see: updated docs page). The options are a mix of csvkit grep and unix grep.

Regex is hampered quite a bit by URL limitations e.g. neither forward slash nor backslash can be used outside of the query string (since forward slash means pipe).

andylolz commented 10 years ago

This is pretty much done now…

I stripped out 'basic match' in favour of regex match. Maybe both options would be better (i.e. the csvkit way, rather than the unix way)?