Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

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

by bichonfrise74 (Vicar)
on Apr 18, 2009 at 05:18 UTC ( [id://758405]=note: print w/replies, xml ) Need Help??


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

Would this work?
#!/usr/bin/perl use strict; my @file = <DATA>; foreach my $i (@file) { $i =~ s/\n/ /; $i =~ /^A\d\.\d\./ ? print "\n$i" : print $i; } __DATA__ A6.8.5 This is an example sentence A6.8.6 This is an example sentence

Replies are listed 'Best First'.
Re^2: How to remove extra line breaks (using regexp)?
by Anonymous Monk on Apr 18, 2009 at 07:39 UTC
    yes, it works, thanks

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2024-04-25 15:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found