|
[Sponsors] |
March 30, 2005, 12:05 |
Search and Replace related
|
#1 |
Guest
Posts: n/a
|
Hi, I have an input file (input.txt): ====== # The four columns represent Name, Country, Age and # City respectively.
John China 28 Beijing Matt USA 40 San-Francisco 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. |
|
March 30, 2005, 12:12 |
Re: Search and Replace related
|
#2 |
Guest
Posts: n/a
|
BTW, The input file looks a little distorted when this is posted here. It should be:
(On Row 1) John China 28 Beijing (On Row 2) Matt USA 40 San-Francisco (On Row 3) Cathy Englan 50 London .... .... |
|
|
|