There's a file containing a table with the parameter names as the first line, values in the following lines:
How to perform the following using awk
, sed
or any shell scripting utility:
- generate a config file named
fileXX
for each line, - transpose each line column values to rows (lines) in each generated config file,
- in each file concatenate the first line which represent the parameter names to the transposed columns values to appear like parameter name-value pairs.
Source file:
Column1 Column2 Column3
Row1_Col1 Row1_Col2 Row1_Col3
Row2_Col1 Row2_Col2 Row2_Col3
Row3_Col1 Row3_Col2 Row3_Col3
OUtPut files:
File1
Column1=Row1_Col1 Column2=Row1_Col2 Column2=Row1_Col3
File2
Column1=Row2_Col1 Column2=Row2_Col2 Column2=Row2_Col3
File3
Column1=Row3_Col1 Column2=Row3_Col2 Column2=Row3_Col3