suneel.reddy has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks,
This post is an extention of earlier post.
I have a file name like - 20130101Customer100.imp , now I need to truncate 20130101 from the file name.
based on the solutions offered from earlier post, I made it as,
$file =~ s/^\D*\d+// ;
which gave me 'Customer100' after removing the extention (.imp)
Okay...now the problem is - I need to insert some timestamp between 'Customer' and '100'.
It should look like Customer_<TimeStamp>_100. I can get the timestamp, but not sure how to fit it in that string.
Please help me.....!!!!
Thanks in advance.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Remove digits from a string and add timestamp to the result
by johngg (Canon) on Jan 02, 2013 at 12:03 UTC | |
Re: Remove digits from a string and add timestamp to the result
by Ratazong (Monsignor) on Jan 02, 2013 at 11:45 UTC | |
Re: Remove digits from a string and add timestamp to the result
by ww (Archbishop) on Jan 02, 2013 at 13:31 UTC | |
Re: Remove digits from a string and add timestamp to the result
by sen (Hermit) on Jan 02, 2013 at 11:43 UTC |
Back to
Seekers of Perl Wisdom