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.
compare 2 rows of a file using awk
Name: Latha Date: September 12, 2007 at 23:43:56 Pacific OS: Unix CPU/Ram: P4 Product: dell
Comment:
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 column numbers where they are mismatching. I need to do this using unix and awk.Please help.
Name: Devaraj (by Fidy) Date: September 14, 2007 at 19:32:15 Pacific
Reply:
Latha,
you can simply do a diff file1 file 2 > outfile . read manual for diff.
Devaraj T
Regards, Devaraj Takhellambam
0
Response Number 2
Name: Latha Date: September 18, 2007 at 07:49:37 Pacific
Reply:
The output of diff command is diffcult to comprehend. and if both the files have the same contents but if the order is different, still it says they are different.
0
Response Number 3
Name: Devaraj (by Fidy) Date: September 20, 2007 at 19:13:39 Pacific
Reply:
Latha,
You should first sort both the files - if u have a key to sort..it will e best..or else just do a simple sort and then do a diff
Summary: Hi, I too am a 'newbie' at scripting. This is a problem that I have been stuck on for a while. I have a script that is creating files from another system, and adding them into a specific directory...
Summary: Is there a way to update the contents of a file (this file contains a list of sqls) without piping it to a new file using a shell script ? I have 15 processes reading from a file and I want each of th...
Summary: How do i delete first line of a file. The file starts with page break ^L. The first line contains the page break ^L. The file may have multiple pagebreaks and I don't want to delete from the file. I ...