Please help me to convert the row values into column.My input file.dat is: First two fields are alpha string and numbers respectively and input will always have same number of fields i.e., 6.INPUTA|1|DLT|07:30|10:30|34A|1|STG|07:30|10:30|NAA|1|MAIN|06:30|10:30|NAA|2|STG|07:30|10:30|NAA|2|UNLD|04:30|10:30|90B|1|DLT|03:30|10:30|34B|1|STG|07:30|09:30|NAB|1|MAIN|07:25|10:30|NAB|1|UNLD|05:30|12:30|8There is a change in the output. Output fields have 18 fields for all the rows and each row will have 1st two fields of input file followed with 3rd,...,18th fields in below order in which blank fields are missing rows in input file and order of records are DLT,STG,MAIN,UNLD following with corresponding records.OUTPUTA|1|DLT|07:30|10:30|34|STG|07:30|10:30|NA|MAIN|06:30|10:30|NA|||| A|2|||||STG|07:30|10:30|NA|||||UNLD|04:30|10:30|90B|1|DLT|03:30|10:30|34|STG|07:30|09:30|NA|MAIN|07:25|10:30|NA|UNLD|05:30|12:30|8UNLD is missing for A|1  DLT and MAIN are missing for A|2    none of the records are missing Similarly if any of the records corresponding to 3rd field of input file are missing then it has to be replaced with blank values so that output fields will have 18 fields.
How to convert row to column
linux;shell script;text processing