Interesting .. How do I handle this in Unix / Perl ?
This is how my input file is ( comma sepertated ):-
L,id,name,address,city,measure_id_1,measrure_id_qty_1,measure_id_2,measure_id_qty_2
D,123,vvc,wwwew wdwe,hou,zip,77057,tel,832
L,id,name,address,city,measure_id_1,measrure_id_qty_1
D,222,abc,dsdsd wwew wdwe,ny,zip,77057
L,id,city,measure_id_1,measrure_id_qty_1
D,333,dallas,state,tx
i.e It has lable record followed by the detail record, e.g for first set the id is 123, name is vvcm address is "wwwew wdwe"... however, measure_id_1 is "zip" and measrure_id_qty_1 is "77057" which means zip is 77057. similarily tel is 832.
Now the output I want is like this ...
id,name,address,city,zip,tel,state
123,vvc,wwwew wdwe,hou,77057,832,{NULL}
222,abc,dsdsd wwew wdwe,ny,77057,{NULL},{NULL}
333,{NULL},{NULL},dallas,{NULL},{NULL},tx
what seems to be interesting is I do not have to scan for column headers in L record only but I need to scan the detail records also for the column headers ....
If anyone knows the solution either in shell,awk, perl .. anything is welcome ..
Thanks ...