Computing.Net > Forums > Unix > comparing two files

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

comparing two files

Reply to Message Icon

Name: subhendu81
Date: November 19, 2008 at 22:18:56 Pacific
OS: windows Xp
CPU/Ram: 1gb
Product: dell
Comment:

Hi experts,

I need to compare two files and get the difference between the two files. F1 is the base file.I need to print out all the lines missing in F2, and the extra lines in F2 and also the mismatched lines between F1 and F2. If they are mismatching then i need to print out the exact line number and column numbers where they are mismatching. I need to do this using unix and awk.Please help.

for example:

file F1
======

"account";"slash";"tran_no";"account_name";"rowstamp"
"DEUTSCHE BANK ";"/";" 22";" ";0000000000BAC757
"DEUTSCHE BANK ";"/";" 23";" ";0000000000BAC758
"DEUTSCHE BANK ";"/";" 25";" ";0000000000BAC759
"DEUTSCHE BANK ";"/";" 26";"ARVAL Fuel Card ";0000000000BADD1C
"DEUTSCHE BANK ";"/";" 27";"ARVAL FUEL CARD ";0000000000BADD45
"DEUTSCHE BANK ";"/";" 28";"Petty Cash ";0000000000BADD62
"DEUTSCHE BANK ";"/";" 29";"COLEG LLYSFASI ";0000000000BADD8D
"DEUTSCHE BANK ";"/";" 30";"G.Rowlands ";0000000000BADD90
"DEUTSCHE BANK ";"/";" 31";"DEESIDE COLLEGE ";0000000000BADDB5
"DEUTSCHE BANK ";"/";" 33";"C DAVIES EXPENSES ";0000000000BADE51
"DEUTSCHE BANK ";"/";" 34";"CAPITA ";0000000000BADE54
"DEUTSCHE BANK ";"/";" 35";"LOMBARD ";0000000000BADE81
"DEUTSCHE BANK ";"/";" 36";"ARVAL FUEL ";0000000000BADEAC
"DEUTSCHE BANK ";"/";" 37";" ";0000000000BADF76
"DEUTSCHE BANK ";"/";" 38";" ";0000000000BADF79

file F2
=======

"account";"slash";"tran_no";"account_name";"rowstamp"
"DEUTSCHE BANK ";"/";" 21";" ";0000000000BB011A
"DEUTSCHE BANK ";"/";" 23";"ARVAL FUEL ";0000000000BB011B
"DEUTSCHE BANK ";"/";" 24";"AAT - E FERRARA ";0000000000BB011C
"DEUTSCHE BANK ";"/";" 28";"LOMBARD VEHICLE MANAGEMENT ";0000000000BB0379
"DEUTSCHE BANK ";"/";" 29";" ";0000000000BB03BF
"DEUTSCHE BANK ";"/";" 30";" ";0000000000BB03C2
"DEUTSCHE BANK ";"/";" 31";" ";0000000000BB03C5
"DEUTSCHE BANK ";"/";" 32";" ";0000000000BB03C8
"DEUTSCHE BANK ";"/";" 33";" ";0000000000BB03EE
"DEUTSCHE BANK ";"/";" 34";"E FERRARA EXPENSES ";0000000000BB047A
"DEUTSCHE BANK ";"/";" 35";"R DAVIES ";0000000000BB04A9
"DEUTSCHE BANK ";"/";" 36";"LEASE 360 EVOLUTION ";0000000000BB04D7
"DEUTSCHE BANK ";"/";" 39";" ";0000000000BB05D0
"DEUTSCHE BANK ";"/";" 40";" ";0000000000BB05D3
"DEUTSCHE BANK ";"/";" 41";" ";0000000000BB05D6
"DEUTSCHE BANK ";"/";" 42";" ";0000000000BB05D9
"DEUTSCHE BANK ";"/";" 43";" ";0000000000BB05DC
"DEUTSCHE BANK ";"/";" 44";" ";0000000000BB05DF


Thanks in advance




Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: comparing two files

compare two files and diff file wil www.computing.net/answers/unix/compare-two-files-and-diff-file-wil/7363.html

compare two files field string www.computing.net/answers/unix/compare-two-files-field-string/8078.html

compare two files www.computing.net/answers/unix/compare-two-files/8438.html