Row to Columns
Hi,
I have a file like this.
1,1,1,0,0,0
1,1,2,1,0,0
1,1,3,0,0,0
1,1,4,0,0,0
...........
...........
1,1,24,0,0,0
1,1,25,0,0,0
1,1,26,1,0,0
1,1,27,0,0,0
1,2,1,0,0,0
1,2,2,0,0,0
1,2,3,0,0,0
1,2,4,0,0,0
1,2,5,1,0,0
1,2,6,1,0,0
............
I need to create an output file like this:
1
1
1
0
0
0
2
1
0
0
Basically, the output is like this:
1. The first record repeats as it is in vertical format.
2. Second record does not repeat completely. If u look at the file between teh first and 2nd record, what si common is 1,1. So, that is not repeated. But the data from 3rd column and onwards comes.
3. This repeats till we loop through all the 1,1 in the first and 2nd columns.
4. Then we start with record 1,2,1,0,0,0, because the first and the 2nd columns do not match
5. When we read the next record, we skip 1,2 and just take values from 3rd column onwards.
Hope my requirement or description is clear. Thanks.
Satish