PDA

View Full Version : CSV filter



jjj2k
03-06-2011, 10:23 PM
Hi there guys!

I have a CSV file with over 15million rows which weighs about 3.15GB. Needless to say I can't open it on excel but I don't need all the data anyway.

The rows start with either DA or DH in the first column. I want a batch script or something that will extract rows starting with DH only.

Any suggestions on how I can do it?

mdmackillop
03-07-2011, 05:43 AM
Recent question here (http://www.vbaexpress.com/forum/showthread.php?t=36262) which may assist. Look at Posts 2 & 3

Tinbendr
03-07-2011, 08:49 AM
Also an article here. (http://msdn.microsoft.com/en-us/library/ms974559.aspx)

jjj2k
03-07-2011, 09:06 PM
Thanks guys for your suggestions.

I did it using a windows batch file (thank god it was a CSV)

-- start of batch file --
@echo off
for /f "tokens=* delims=," %%a in ('findstr /B "DH" C:\temp\GTAM2310.002') do echo %%a >> C:\temp\testM1.csv
- end of batch file --