Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Regex selection based upon position

by Hena (Friar)
on Nov 15, 2005 at 11:22 UTC ( [id://508551]=note: print w/replies, xml ) Need Help??


in reply to Regex selection based upon position

Perhaps split?
while (<FILE>) { chomp; print join(";",split (/\s+/,$_)),"\n"; }

Replies are listed 'Best First'.
Re^2: Regex selection based upon position
by Perl Mouse (Chaplain) on Nov 15, 2005 at 12:42 UTC
    Using split to separate fix-width data sounds like a terrible idea to me. While short data will be padded with whitespace, there's no garantee all data is short - a 6 character entry in a 6 character wide field will not be padded. Furthermore, since the data is fixed-width, there's no need to escape whitespace - there might be whitespace as data. In fact, what you think is padding might actually be part of the data!
    Perl --((8:>*
Re^2: Regex selection based upon position
by BUU (Prior) on Nov 15, 2005 at 11:34 UTC
    "RESOURCE ORA"
      Sod. Didn't notice that. So this is no go.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (4)
As of 2024-04-24 22:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found