Hi, I have an input file (input.txt): ====== # The four columns represent Name, Country, Age and City respectively.
(Row 1) John China 28 Beijing
(Row 2) Matt USA 40 San-Francisco
(Row 3) Cathy Englan 50 London
.. .. ..
.. .. ..
======
I have a Master template file (Master.txt):
$Name is from $Country. $Name is $Age years old, and comes from $City.
======
For each row (person) in the input file, I would like a new output to be produced with the filename $Name.txt, which is based on the Master.txt template.
Can someone show how this is easily done. (I was told that gawk/awk (or sed) could do it easily, but I am not very familiar with them yet, and I did not find a similar example in the User Guide for GAWK.) Thanks.
(Row 1) John China 28 Beijing
(Row 2) Matt USA 40 San-Francisco
(Row 3) Cathy Englan 50 London
.. .. ..
.. .. ..
======
I have a Master template file (Master.txt):
$Name is from $Country. $Name is $Age years old, and comes from $City.
======
For each row (person) in the input file, I would like a new output to be produced with the filename $Name.txt, which is based on the Master.txt template.
Can someone show how this is easily done. (I was told that gawk/awk (or sed) could do it easily, but I am not very familiar with them yet, and I did not find a similar example in the User Guide for GAWK.) Thanks.