in reply to Re: How to remove extra line breaks (using regexp)?
in thread How to remove extra line breaks (using regexp)?

Well, yeah, that is the problem. There is other shitty thing also in this .txt file that I'm trying to clean but basically the lines that I want to keep starts with a letter and a digit.
  • Comment on Re^2: How to remove extra line breaks (using regexp)?

Replies are listed 'Best First'.
Re^3: How to remove extra line breaks (using regexp)?
by ikegami (Patriarch) on Apr 17, 2009 at 14:40 UTC
    my $file = do { local $/; <DATA> }; $file =~ s/\n(?!A\d+\.)/ /g; $file .= "\n"; print $file; __DATA__ A6.8.5 This is an example sentence A6.8.6 This is an example sentence
    A6.8.5 This is an example sentence A6.8.6 This is an example sentence
      Thanks!!!