Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

parse and filter a txt file

43 views
Skip to first unread message

Abhijat

unread,
Aug 30, 2012, 10:24:06 AM8/30/12
to
Hi All,
Is it possible to extract filtered data from a txt file using DOS?
I have a txt file with 6 fields separated by comma. One of those fields has an ID on which I want to apply filter. The IDs that are to be used to apply filter and extract data are in another txt file.
Much like:
File1 -data.txt
a,s,d,f,AA,t
s,d,f,g,AA,g
d,f,g,h,BB,h
f,ge,tr,g,CC,k

File2 -ID.txt AA,CC
The result should be
a,s,d,f,AA,t
s,d,f,g,AA,g
f,ge,tr,g,CC,k

Thanks very much.

Kind Regards,
Abhijat

foxidrive

unread,
Aug 30, 2012, 11:02:37 AM8/30/12
to
Use findstr and the /g:file.txt switch to give you the search terms and the first file as the input file.



--
Mic

Abhijat

unread,
Aug 30, 2012, 3:57:05 PM8/30/12
to
Thanks .. I tried using findstr earlier but did not seem to do the job. May be because the file I am hitting in roughly 1 gb.
I ll try again.
0 new messages