Hi all,
Just wondering what the best way is to select particular fields from particular records in comma delimited data files.
say I have the file file1.dat
1,header
2,123,23,1,,1,1,5
2,124,23,1,,1,3,9
2,125,23,1,,2,1,5
9,footer
and I want to create a file file2.dat containing only records from file1.dat where field1 = '2' and field6 = '1'
and I only want fields 2,3,6,7 & 8
Thus file2.dat
123,23,1,1,5
124,23,1,3,9
Thanks
Kenton
Just wondering what the best way is to select particular fields from particular records in comma delimited data files.
say I have the file file1.dat
1,header
2,123,23,1,,1,1,5
2,124,23,1,,1,3,9
2,125,23,1,,2,1,5
9,footer
and I want to create a file file2.dat containing only records from file1.dat where field1 = '2' and field6 = '1'
and I only want fields 2,3,6,7 & 8
Thus file2.dat
123,23,1,1,5
124,23,1,3,9
Thanks
Kenton