in reply to copying records from one file to another with filter.

>perl -ne"next unless /^4-Dec-2009/; print; last }{ print while <>" ju +nk.dat 4-Dec-2009,78,198 5-Dec-2009,98,155 6-Dec-2009,10,180 7-Dec-2009,51,91 8-Dec-2009,32,130 9-Dec-2009,29,207

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"I'd rather go naked than blow up my ass"

Replies are listed 'Best First'.
Re^2: copying records from one file to another with filter.
by avanta (Beadle) on Jan 09, 2010 at 18:16 UTC
    Im sorry but I didnt get how this code works... Im tryin to write this code for an ETL process. here my DB is a flat file. I need to filter our records as per a date range, eg. last 30 days or smthing like that and write it to a new file..