Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

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.out

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

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: CUFP [id://838205]
Approved by ww
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2015-08-28 05:40 GMT
Find Nodes?
    Voting Booth?

    The oldest computer book still on my shelves (or on my digital media) is ...

    Results (334 votes), past polls