Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Remove digits from a string and add timestamp to the result

by Ratazong (Prior)
on Jan 02, 2013 at 11:45 UTC ( #1011252=note: print w/ replies, xml ) Need Help??


in reply to Remove digits from a string and add timestamp to the result

This depends on the exact format of the filename. But possible the following example will give you an idea:

my $filename = "customer100"; my $timestamp= "02012013"; $filename =~ /(\w+)(\d+)/; # split filename into "custome +r" and "100" $filename = $1."_".$timestamp."_".$2;
HTH! Rata


Comment on Re: Remove digits from a string and add timestamp to the result
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1011252]
help
Chatterbox?
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: (5)
As of 2015-08-31 07:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

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













    Results (353 votes), past polls