![]() |
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 |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Help with Flat Files Please!! BASH (New User) | cyberjax21 | Shell Programming and Scripting | 0 | 02-27-2006 09:19 PM |
| How to compare two flat files and get changed data | jtshashidhar | Shell Programming and Scripting | 3 | 01-29-2006 10:26 PM |
| Column names in flat files | srivsn | Shell Programming and Scripting | 1 | 12-27-2005 06:47 AM |
| How to compare data in two flat files and update them? | rajus19 | Shell Programming and Scripting | 3 | 11-08-2005 11:13 AM |
| Flat Files | thumsup9 | Shell Programming and Scripting | 2 | 02-02-2005 03:21 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Compare 2 flat files
Hi Gurus,
I searched the forum but didnt get much info. I want to compare 2 files. 1)Newfile comes today with 2)Old file of previous day. The files are same ,just the new files might have new records sometimes. So I want to capture these new records in another file. Can anyone help me in this ?? Thanks |
|
||||
|
The following should work:
Code:
diff old_file new_file | grep ">" | cut -b 3- > new_records.txt Records that are in the old file only will not be in the new one. |
|
||||
|
Quote:
/usr/xpg4/bin/grep -v -f oldfile newfile > diff_file |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|