Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Search and replace the word in Column 16

by jdtoronto (Prior)
on Jul 25, 2006 at 12:13 UTC ( [id://563492]=note: print w/replies, xml ) Need Help??


in reply to Search and replace the word in Column 16

Maybe you could split the record,
my @fields = split /|/, $record;
The replace the field if necessary and then recreate the record by joining the fields again?

I am sure someone will have a far more efficient and exotic answer, but sometimes first principles works.

Of course, gellyfish is right, the | should be escaped:

my @fields = split /\|/, $record;
jdtoronto

Replies are listed 'Best First'.
Re^2: Search and replace the word in Column 16
by gellyfish (Monsignor) on Jul 25, 2006 at 12:17 UTC

    I don't think you meant split /|/ as witnessed by the the output of the following:

    print +join '*', split /|/, 'AT0000937503|20060530|||142.708534||GROUP + AG|30618720||||OPEN|ISIN|4943402|VSE|STOCK|39600000|0.77320';
    You need to escape the regex metacharacter '|'.

    /J\

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2024-04-24 20:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found