Hello,
I have a file like:
str1,"HEX"H,(39),info
str2,"HEX"H,(854548),info
str3,"HEX"H,'BGTOUR',info
str4,"HEX"H,(534322),info
str1,"HEX"H,,info
str3,"HEX"H,'Landing',info
str4,"HEX"H,'BG',info
str1,"HEX"H,,info
str3,"HEX"H,'Ay',info
str1,"HEX"H,(27),info
str2,"HEX"H,(854548),info
str4,"HEX"H,(534530),info
How can I append lines until it reaches next str1, output like that:
str1,"HEX"H,(39),info,str2,"HEX"H,(854548),info,str3,"HEX"H,'BGTOUR',info,str4,"HEX"H,(534322),info
str1,"HEX"H,,info,,,,,str3,"HEX"H,'Landing',info,str4,"HEX"H,'BG',info
str1,"HEX"H,,info,,,,,str3,"HEX"H,'Ay',info,,,,
str1,"HEX"H,(27),info,str2,"HEX"H,(854548),info,,,,,str4,"HEX"H,(534530),info
They are supposed to be four lines, each with 4 fields.
str1 is always there.
str2, str3 and str4 can be missing.
Is it possible to put commas for the empty spaces as it is marked in red above.
Thanks!