Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: pipe delimited file problem

by imp (Priest)
on Jan 22, 2007 at 02:27 UTC ( #595839=note: print w/ replies, xml ) Need Help??


in reply to pipe delimited file problem

You can use a zero-width positive look behind, like this:
use strict; use strict; while (<DATA>) { s/(?<=\|)\|/empty|/g; print; } __DATA__ |a||| |||| |||a|
I usually find it easier to maintain code that uses split though.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (8)
As of 2016-07-28 18:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What is your favorite alternate name for a (specific) keyboard key?


















    Results (255 votes). Check out past polls.