I need to print certain fixed values as well as values from other files, file1
and file2
into new file output using awk
command.
file1:
100,1
102,3
104,4
file2:
103,4
108,6
109,7
my command
I did with the help of paste command: In file1:first 4 fields are present In file3:contents between file1 and file2 Merged all files using paste command. I wanted to do it directly without paste command usage awk -F '{print "100",0,1,contents_of_file1,"1","0",contents_of_file2}' > output
output:
100,0,1,100,1,1,0,103,4
100,0,1,102,3,1,0,108,6
100,0,1,104,4,1,0,109,7
First 3 values are default fixed, 4th and 5th column values are from file1,6th and 7th column values are fixed default values and last 2 columns are contents of file2