BrianWilson
Programmer
Hi all,
Sorry for what may be a newbie question, but I've read what I can on awk and nawk and can't fathom this out. Any help would be greatly appreciated.
I have two files. "columns.cfg" is a config file and "data.txt" is the data.
columns.cfg (one single line)
A,B,C,D,E,...etc.
data.txt
1,2,3,4,5
11,12,13,14,15...etc
What I need to do is have a third output file of the following format:
A,NR,B,1,C,2,D,3,E,4
A,NR,B,11,C,12,D13,E14....etc.
In essence, apart from the first config column, which will be the row number in the file, the column in column.cfg should be paired with the "position less one" element in data.txt
Hope this is clear. Please can you assist?
Sorry for what may be a newbie question, but I've read what I can on awk and nawk and can't fathom this out. Any help would be greatly appreciated.
I have two files. "columns.cfg" is a config file and "data.txt" is the data.
columns.cfg (one single line)
A,B,C,D,E,...etc.
data.txt
1,2,3,4,5
11,12,13,14,15...etc
What I need to do is have a third output file of the following format:
A,NR,B,1,C,2,D,3,E,4
A,NR,B,11,C,12,D13,E14....etc.
In essence, apart from the first config column, which will be the row number in the file, the column in column.cfg should be paired with the "position less one" element in data.txt
Hope this is clear. Please can you assist?