Good evening
I need to extract some data from a file, each entry comprises three rows of data and I need to be able to select fields from each of the three rows. The 4th field in each of the three rows has a different three character code. The fields are comma seperated.
The file looks similar to this:
xxxxxxx,xxxxxx,xxxxx,aaa,x,x,x,x,x,x,x,x,x,x
xxxxxxx,xxxxxx,xxxxx,bbb,,x,x,x,x,x,x,x,x,x,x,x,x
xxxxxxx,xxxxxx,xxxxx,ccc,,,,x,,x,,,,x,,x,,,x,
xxxxxxx,xxxxxx,xxxxx,aaa,x,x,x,x,x,x,x,x,x,x
xxxxxxx,xxxxxx,xxxxx,bbb,,x,x,x,x,x,x,x,x,x,x,x,x
xxxxxxx,xxxxxx,xxxxx,ccc,,,,x,,x,,,,x,,x,,,x,
xxxxxxx,xxxxxx,xxxxx,aaa,x,x,x,x,x,x,x,x,x,x
xxxxxxx,xxxxxx,xxxxx,bbb,,x,x,x,x,x,x,x,x,x,x,x,x
xxxxxxx,xxxxxx,xxxxx,ccc,,,,x,,x,,,,x,,x,,,x,
If I wanted to select, for example, field 10 and 12 from row 1 those with aaa, and field 16 from row 2 (bbb) and field 8 and 11 from row three (ccc) is there a way with a script I can do this?
Thanks
Alan
I need to extract some data from a file, each entry comprises three rows of data and I need to be able to select fields from each of the three rows. The 4th field in each of the three rows has a different three character code. The fields are comma seperated.
The file looks similar to this:
xxxxxxx,xxxxxx,xxxxx,aaa,x,x,x,x,x,x,x,x,x,x
xxxxxxx,xxxxxx,xxxxx,bbb,,x,x,x,x,x,x,x,x,x,x,x,x
xxxxxxx,xxxxxx,xxxxx,ccc,,,,x,,x,,,,x,,x,,,x,
xxxxxxx,xxxxxx,xxxxx,aaa,x,x,x,x,x,x,x,x,x,x
xxxxxxx,xxxxxx,xxxxx,bbb,,x,x,x,x,x,x,x,x,x,x,x,x
xxxxxxx,xxxxxx,xxxxx,ccc,,,,x,,x,,,,x,,x,,,x,
xxxxxxx,xxxxxx,xxxxx,aaa,x,x,x,x,x,x,x,x,x,x
xxxxxxx,xxxxxx,xxxxx,bbb,,x,x,x,x,x,x,x,x,x,x,x,x
xxxxxxx,xxxxxx,xxxxx,ccc,,,,x,,x,,,,x,,x,,,x,
If I wanted to select, for example, field 10 and 12 from row 1 those with aaa, and field 16 from row 2 (bbb) and field 8 and 11 from row three (ccc) is there a way with a script I can do this?
Thanks
Alan