Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
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.


Comment on Re: pipe delimited file problem
Download Code

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 scrutinizing the Monastery: (9)
As of 2014-12-26 04:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (165 votes), past polls