Text filtering tool?

Soldato
Joined
13 Nov 2002
Posts
3,589
I have a 500,000+ line CSV file. I'd like to filter out a lot of it to find what I want. The tool should :

- have multiple inclusion and exclusion filters.

- be able to filter by line.

- run under Windows and / or Linux.

- be free. :p

e.g.

1. Alpha Bravo Charlie Delta
2. Echo Foxtrot Gamma Hotel Alpha Charlie
3. India Joker Kilo Lima Alpha

I want only lines containing the words Alpha and Charlie, but not the word Echo.

I put Alpha in the first inclusion filter. No lines are hidden.

I put Charlie in the second inclusion filter. Line 3 is now hidden.

I put Echo in the first exclusion filter. Line 2 is now hidden.

Leaving just line 1.


Does such a tool exist, or do I have to brush up on regular expressions and cobble together some PHP code?
 
Hmm, initially would've said do it in Excel but you have too many lines.

You could probably do a batch file using findstr, depending on how complex you need it to be and how often the criteria is going to change.

edit: For the above example something like...

findstr /I "alpha" inputfile.csv|findstr /I "charlie"|findstr /I /V "echo">>outputfile.csv
 
Last edited:
Back
Top Bottom