getting wrong output with AWK command!!!

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 :frowning:

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...:frowning:

Thanks in advance!

The ' character prevents variable expansion.

awk -v oldfilecount=$oldfilecount 'NR>oldfilecount' $eachfile | sed 's/"//g' > outfile

Ad hoc:

# more file.old
old text
old text
old text
# more file.new
old text
old text
old text
new text
new text
new text
# 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 ----------

Thank you for clarifying me...Now the script is working fine..:):b: