Hi
I want to compare 2 files. The files have the same amount of rows and columns. So each line must be compare against the other and if one differs from the other, the result of both must be stored in a seperate file.
I am doing this in awk.
Here is my file1:
Blocks Reserved,CELL,1A,,,,AGBLK,5,5,1,CELL,1A,,,,ERICSSON,GSM,07B
Blocks Reserved,CELL,1A,,,,AGBLK,5,5,1,CELL,1A,,,,ERICSSON,GSM,07B
Blocks Reserved,CELL,1B,,,,AGBLK,2,2,1,CELL,1B,,,,ERICSSON,GSM,07B
Blocks Reserved,CELL,1B,,,,AGBLK,2,2,1,CELL,1B,,,,ERICSSON,GSM,07B
Here is my file 2:
Blocks Reserved,CELL,1A,,,,AGBLK,0,0,1,CELL,1A,,,,ERICSSON,GSM,07B
Blocks Reserved,CELL,1A,,,,AGBLK,0,0,1,CELL,1A,,,,ERICSSON,GSM,07B
Blocks Reserved,CELL,1B,,,,AGBLK,2,2,1,CELL,1B,,,,ERICSSON,GSM,07B
Blocks Reserved,CELL,1B,,,,AGBLK,2,2,1,CELL,1B,,,,ERICSSON,GSM,07B
Duplicate data may be ignored, so resultant file is:
Blocks Reserved,CELL,1A,,,,AGBLK,5,5,1,CELL,1A,,,,ERICSSON,GSM,07B
Blocks Reserved,CELL,1A,,,,AGBLK,0,0,1,CELL,1A,,,,ERICSSON,GSM,07B
Here is my script:
awk -F',' -v file1="$1" -v file2="$2" '{print;}1' OFS="," diff $1 $2 > resultfile.csv
Can you help me please.