9

awk read in file1, gsub in file2, print to file3

view full story
linux-howto

http://www.unix.com – I'm trying to use awk to do the following. I have file1 with many lines, each containing 5 fields describing an individual set. I have file2 which is a template config file with variable space holders to be replaced by the values in file1. I would like to substitute each set of values in file1 with the variable place holders in file2 and then print to a unique file3 for each row in file1: file1 Code: sample1 300 150 100 23 sample2 320 150 90 20 sample3 340 160 95 21 file2 ... Code: <general> execute=var1 range=var2 sub=var3 mu=var4 sigma=var5 </general> ... file3.1 .. (HowTos)