![]() |
|
|
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 |
| wrong output in perl script | namishtiwari | Shell Programming and Scripting | 2 | 07-03-2009 07:35 AM |
| tr command giving wrong output | usha rao | Shell Programming and Scripting | 8 | 05-08-2009 08:13 AM |
| Sort command giving wrong output | usha rao | Shell Programming and Scripting | 8 | 04-07-2009 09:54 AM |
| Command display output on console and simultaneously save the command and its output | satimis | UNIX for Dummies Questions & Answers | 7 | 01-25-2009 08:27 PM |
| Printing to a Savin - Size of output wrong | h1timmboy | AIX | 2 | 02-28-2006 09:19 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|
|
||||
|
i have a file which gets appended with 9 records daily and the file keeps growing from then...i use to store the previous day files count in a variable called oldfilecount and current files count as newfilecount.my requirement is that i need to start processing only the new records from the file....i mean only if newffilecount > oldfilecount and only fetch the current days 9 records and process it...the no of records which is 9 as of now might vary later..so i just need to fetch the records which has come for today neglecting all the previous days records and process the current records alone...
i tried awk 'NR>$oldfilecount {print $0}' $eachfile | sed 's/"//g' > outfile but i m getting all the records displayed...even the old records :-( but when i give awk 'NR>64 {print $0}' $eachfile | sed 's/"//g' > outfile i get only the current days records... How do i get my job done...since the oldfilecount variable keeps changing and based on that i need to filter out the old records and fetch only the new records and process it... ![]() Thanks in advance! |
|
||||
|
Ad hoc:
Code:
# more file.old old text old text old text # more file.new old text old text old text new text new text new text Code:
# diff --suppress-common-lines file.old file.new | egrep '^[<|>]' | sed 's/[<|>] //' new text new text new text |
|
||||
|
Thank You Dr.house for your timely help
---------- Post updated at 07:40 PM ---------- Previous update was at 07:39 PM ---------- Quote:
![]() |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|