Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

un-format currency

by hossman (Prior)
on May 03, 2010 at 21:44 UTC ( #838205=CUFP: print w/replies, xml ) Need Help??

Note to self: when someone has helpfully mudded up the data by adding commas and dollar signs to currency values, this can be easily undone...

perl -ple '$_ = reverse; s/(\d{3})\,(?=[\d,]+\$)/$1/g; s/\$//g; $_ = r +everse' < data.in > data.out

Replies are listed 'Best First'.
Re: un-format currency
by toolic (Bishop) on May 03, 2010 at 22:47 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: CUFP [id://838205]
Approved by ww
help
Chatterbox?
Discipulus hitting the edge: panic: gen_constant_list JMPENV_PUSH returned 2 at -e line 1.
[choroba]: Discipulus Writing one-liners in XS?
[Discipulus]: eh eh.. almost.. Discipulus's scratchpad

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (7)
As of 2018-02-21 13:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When it is dark outside I am happiest to see ...














    Results (280 votes). Check out past polls.

    Notices?