Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: (nrd) removing all whitespace but newlines

by newrisedesigns (Curate)
on Jan 28, 2003 at 19:31 UTC ( #230700=note: print w/ replies, xml ) Need Help??


in reply to removing all whitespace but newlines

Does each field have only A-Z0-9 characters?

If so,
$_ =~ /((\w{12})\n)/;
$1 = the 12 digit field plus the newline, while $2 = the 12 digit field without.

If you need other characters, you could use
$_ =~ /(([A-Za-z0-9\.\+\-]{12})\n)/;
To get alphanumerics and '.', '+', and '-'.

John J Reiser
newrisedesigns.com


Comment on Re: (nrd) removing all whitespace but newlines
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2014-11-27 23:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (190 votes), past polls