Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Removing some part of string

by trizen (Friar)
on Nov 02, 2011 at 13:18 UTC ( #935392=note: print w/ replies, xml ) Need Help??


in reply to Removing some part of string

while (defined($_ = <DATA>)) { my (@array) = split(/,/, $_, 0); if ($array[-1] =~ /^\h*(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct| +Nov|Dec)\./) { splice @array, -1; } print join(',', @array) . "\n"; } __DATA__ $line = U.S. abc xyz , newyork, USA, Feb. 2-4 $line =pqr ffg , Long Beach, california, Sep. 12-14 $line = Hello , St. Louis, Missouri, Mar. 29-31 $line = hello, How are u


Comment on Re: Removing some part of string
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (7)
As of 2014-07-31 06:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (245 votes), past polls