Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: how to in-place update a dataset?

by kcott (Archbishop)
on Mar 14, 2013 at 03:47 UTC ( [id://1023357]=note: print w/replies, xml ) Need Help??


in reply to how to in-place update a dataset?

G'day littlewenwen,

Welcome to the monastery.

One way to do that is with Tie::File:

$ cat > fred.dat abcd 123 456 defg cdefg 23 as 345 235 xsd swe
$ perl -Mstrict -Mwarnings -e ' use Tie::File; tie my @fred_data, q{Tie::File}, q{fred.dat} or die $!; @fred_data = map { s/(^|\t)(?=\t|$)/${1}Missing/g; $_ } @fred_data +; untie @fred_data; '
$ cat fred.dat abcd 123 456 defg cdefg 23 Missing as Missing 345 235 Missing xsd Missing swe Missing

-- Ken

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (2)
As of 2024-04-25 06:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found