![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Emergency UNIX and Linux Support !! Help Me!! Post your urgent questions here for highest visibility. Posting a new thread to this forum requires Bits. We monitor this forum to help people with emergencies, but we do not guarantee response time or answers. This forum is "best effort" only. Members who reply to posts here receive a bonus of 1000 Bits per reply. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Help to find the time difference between the lines | sathik | Shell Programming and Scripting | 4 | 09-14-2009 07:35 AM |
| find difference in file column... | malcomex999 | Shell Programming and Scripting | 1 | 04-15-2009 06:31 AM |
| script to compare first column of two files and find difference | adityam | Shell Programming and Scripting | 3 | 10-22-2008 10:02 AM |
| RCS - Find difference between 2 different versions of a file | kelangovan | UNIX for Advanced & Expert Users | 1 | 05-20-2008 09:47 AM |
| Difference between locate and find | camerja1 | UNIX for Dummies Questions & Answers | 1 | 06-25-2002 02:55 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|
|
||||
|
I have a file which gets appended with records daily..for eg. 1st day of the month i get 9 records ,2nd day 9 records .....till the last day in the month...the no of records may vary...i store the previous days file in a variable oldfile=PATH/previousdaysfile....i store the current days file in a variable newfile=PATH/currentdayfile. i only want the records that is present only in the current days file...
i tried comm -23 $newfile $oldfile...but i am getting error. Please help me out. ![]() |
|
||||
|
If you know the number of records (you said they vary, but maybe the number is known somehow), then simply "tail" the last <n> records, where <n> is the number of records (i suppose records to be lines):
Code:
tail -<n> /path/to/newfile Code:
tail -$((<x>*<n>)) /path/to/newfile Code:
sed '1,'"$((<number_of_the_day-1>*<x>))"'d' /path/to/newfile bakunin Last edited by bakunin; 09-30-2009 at 10:13 AM.. |
|
||||
|
|
|
||||
|
$ comm -23 "$oldfile" "$newfile"
i am getting this error comm: cannot open ---------- Post updated at 09:49 AM ---------- Previous update was at 09:34 AM ---------- Thank You guys for your valuable suggestions. comm -23 "newfile" "oldfile" worked fine... i made a small mistake in assigning the files to variables.That's why i was getting error. Thanks once again! |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|