in reply to copying lines in a text file to a new file with a dynamically generated text name

A typical approach is to have a flag which indicates if you currently need you write to an output-file or not.

Just read the input-file line-by-line and determine one of the following four situations:

Of course you might want to add some error-checking, too!

Have fun implementing! If you encounter any Perl-questions, feel free to show your code and where you have issues, so we monks can give you further advice

HTH, Rata
  • Comment on Re: copying lines in a text file to a new file with a dynamically generated text name

Replies are listed 'Best First'.
Re^2: copying lines in a text file to a new file with a dynamically generated text name
by seek_m (Initiate) on Feb 16, 2011 at 09:49 UTC
    Thanks for the idea. i got my thing done..