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!