harris2107
IS-IT--Management
Hi all,
I have two files called INPUT1 and INPUT2 and i am trying to append the values of INPUT1 to INPUT2 using AWK.
The INPUT1 file will always has a single field and the INPUT2 file has 3 fields but both files will have same number of records always. Following is the format of the two files,
INPUT1:
PROD
DEV
QA
INPUT2:
DB1,PRIMARY,NY
DB2,SECONDARY,CA
DB3,TERTIARY,MN
Now, the issue i am working on is to append the values of INPUT1 to the file INPUT2 using awk. So, after appending the output should look like following,
DB1,PRIMARY,NY,PROD
DB2,SECONDARY,CA,DEV
DB3,TERTIARY,MN,QA
i.e., the first record of INPUT1 should be appended to the 1st record (last field) of INPUT2 and so on...... As i said the number of records in each file will be same. So, each record in file1 should be appended to corresponding record in file2.
Any suggestions?
Thanks,
Harris.
I have two files called INPUT1 and INPUT2 and i am trying to append the values of INPUT1 to INPUT2 using AWK.
The INPUT1 file will always has a single field and the INPUT2 file has 3 fields but both files will have same number of records always. Following is the format of the two files,
INPUT1:
PROD
DEV
QA
INPUT2:
DB1,PRIMARY,NY
DB2,SECONDARY,CA
DB3,TERTIARY,MN
Now, the issue i am working on is to append the values of INPUT1 to the file INPUT2 using awk. So, after appending the output should look like following,
DB1,PRIMARY,NY,PROD
DB2,SECONDARY,CA,DEV
DB3,TERTIARY,MN,QA
i.e., the first record of INPUT1 should be appended to the 1st record (last field) of INPUT2 and so on...... As i said the number of records in each file will be same. So, each record in file1 should be appended to corresponding record in file2.
Any suggestions?
Thanks,
Harris.