Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^2: How to remove extra line breaks (using regexp)?

by larus (Acolyte)
on Apr 17, 2009 at 14:12 UTC ( #758246=note: print w/ replies, xml ) Need Help??


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)?
Re^3: How to remove extra line breaks (using regexp)?
by ikegami (Pope) 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!!!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://758246]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (6)
As of 2014-09-02 02:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (18 votes), past polls