in reply to Double blank lines to single blank line

What does your input code look like currently? The appropriate solution depends a lot on how you are doing stuff now and to some extent on what gets done with the data subsequently.


DWIM is Perl's answer to Gödel
  • Comment on Re: Double blank lines to single blank line

Replies are listed 'Best First'.
Re^2: Double blank lines to single blank line
by proactive1 (Initiate) on May 10, 2007 at 23:37 UTC
    A bit too deep into data massaging on this set of data to go back to original code. Good point though. I think I can fix the original code but I need to know what to do to work with the existing set with the double blank lines. There must be a script or a way to do this in word etc quickly.

      Something like:

      use strict; use warnings; my $run = 1; while (<DATA>) { next if $run && m/^\n/; print; $run = m/^\n/; } __DATA__ data as per sample

      with i/o adjusted for your requirements should do what you need to clean up multiple line breaks.


      DWIM is Perl's answer to Gödel