![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| awk - comparing files | dbrundrett | Shell Programming and Scripting | 6 | 01-18-2009 10:51 PM |
| Comparing two files | superstar003 | Forum Support Area for Unregistered Users & Account Problems | 1 | 05-08-2008 03:34 AM |
| Comparing two files.. | padarthy | Shell Programming and Scripting | 1 | 08-29-2007 08:01 AM |
| Comparing two files... | paqman | Shell Programming and Scripting | 12 | 08-08-2007 03:45 AM |
| comparing shadow files with real files | terrym | UNIX for Advanced & Expert Users | 4 | 02-09-2007 02:38 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Comparing 2 files
I’m hoping you can help me with this problem (I posted this yesterday but the posting and replies were lost). We just moved from AIX to Solaris. I have a script which is doing a diff on 2 files to get a file of just differences to be applied. The Solaris diff is creating a different 'diff' file than the AIX
For example I took the files and did the same command on both AIX and Solaris machines. In looking at a portion of the file, this is what is different: Old file: (FILE1) NBBAKER BROOK E7A0A1 NBBAKER BROOK E7A0A2 NBBAKER BROOK E7A0A3 NBSAINT-FRANCOIS-DE-MADAWASKA E7A1A1 NBSAINT-FRANCOIS-DE-MADAWASKA E7A1A2 NBSAINT-FRANCOIS-DE-MADAWASKA E7A1A3 NBSAINT-FRANCOIS-DE-MADAWASKA E7A1A4 NBSAINT-FRANCOIS-DE-MADAWASKA E7A1A5 NBSAINT-FRANCOIS-DE-MADAWASKA E7A1A6 NBSAINT-FRANCOIS-DE-MADAWASKA E7A1A7 NBSAINT-FRANCOIS-DE-MADAWASKA E7A1A8 NBSAINT-FRANCOIS-DE-MADAWASKA E7A1A9 QCSHEFFORD J2M0A1 QCSHEFFORD J2M0A2 QCSHEFFORD J2M0A3 QCSHEFFORD J2M0A4 QCSHEFFORD J2M1A1 QCSHEFFORD J2M1A2 QCSHEFFORD J2M1A3 QCSHEFFORD J2M1A4 QCSHEFFORD J2M1A5 QCSHEFFORD J2M1A6 QCSHEFFORD J2M1A7 QCSHEFFORD J2M1A8 QCSHEFFORD J2M1A9 new File: (FILE2) NBBAKER BROOK E7A0A1 NBBAKER BROOK E7A0A2 NBBAKER BROOK E7A0A3 NBLAC BAKER E7A0A4 NBSAINT-FRANCOIS-DE-MADAWASKA E7A1A1 NBSAINT-FRANCOIS-DE-MADAWASKA E7A1A2 NBSAINT-FRANCOIS-DE-MADAWASKA E7A1A3 NBSAINT-FRANCOIS-DE-MADAWASKA E7A1A4 NBSAINT-FRANCOIS-DE-MADAWASKA E7A1A5 NBSAINT-FRANCOIS-DE-MADAWASKA E7A1A6 NBSAINT-FRANCOIS-DE-MADAWASKA E7A1A7 NBSAINT-FRANCOIS-DE-MADAWASKA E7A1A8 NBSAINT-FRANCOIS-DE-MADAWASKA E7A1A9 QCSHEFFORD J2M0A1 QCSHEFFORD J2M0A2 QCSHEFFORD J2M0A3 QCSHEFFORD J2M0A4 QCSHEFFORD J2M0A5 QCSHEFFORD J2M0A6 QCSHEFFORD J2M1A1 QCSHEFFORD J2M1A2 QCSHEFFORD J2M1A3 QCSHEFFORD J2M1A4 QCSHEFFORD J2M1A5 QCSHEFFORD J2M1A6 QCSHEFFORD J2M1A7 QCSHEFFORD J2M1A8 QCSHEFFORD J2M1A9 So the differences should be to add the records: E7A0A4 J2M0A5 J2M0A6 to file1 Diff statement on AIX: 85035a85072 > NBLAC BAKER E7A0A4 233803a233943,233944 > QCSHEFFORD J2M0A5 > QCSHEFFORD J2M0A6 Diff statement on Solaris: 85035a85072 > NBLAC BAKER E7A0A4 233804,233805c233943,233946 < QCSHEFFORD J2M1A1 < QCSHEFFORD J2M1A2 --- > QCSHEFFORD J2M0A5 > QCSHEFFORD J2M0A6 > QCSHEFFORD J2M1A1 > QCSHEFFORD J2M1A2 I tried using the bdiff, diff -h commands to see if that made any difference but it doesn’t. Any idea what is causing the file to be created differently? I just want to see the same layout as the AIX file. I don't understand why it shows the records to be added on Solaris as sometimes just the record as in E7A0A4 and sometimes showing what records were in both files as in J2M1A1. Thanks, Helen |
|
||||
|
try with comm it worked for me, i had to find the diferences between two files, here is the url of my problem's post, good luck
http://www.unix.com/shell-programmin...t-of-data.html |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|