![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | 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 !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| compare 2 files.. | amon | Shell Programming and Scripting | 8 | 06-23-2008 07:34 AM |
| compare two files | charandevu | Shell Programming and Scripting | 7 | 03-30-2008 12:20 PM |
| Compare files | kharen11 | UNIX for Advanced & Expert Users | 25 | 03-14-2007 02:35 AM |
| compare two txt files | space13 | Shell Programming and Scripting | 8 | 09-22-2006 06:40 AM |
| compare files | ingunix | UNIX for Dummies Questions & Answers | 3 | 05-24-2001 08:44 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
||||
|
||||
|
I am having a brain cramp.
I have file1 and file2. I want to compare file1 and file2 to pull out the differences. I am using diff and putting the results to a new file diff file1 file2 | grep "<" > differences.out I want to take differences.out and tag a date to the beginning of each record. 20030423 "existing record" How do I do this? |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
Code:
diff file1 file2 | grep "<" > differences.out sed "s/^/`date +%Y%m%d` /" < differences.out > TMP_00 mv TMP_00 differences.out |
|
#3
|
||||
|
||||
|
Thanks!
|
||||
| Google The UNIX and Linux Forums |