Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Removing digits from a string

by johngg (Abbot)
on Jan 01, 2013 at 12:39 UTC ( #1011148=note: print w/replies, xml ) Need Help??


in reply to Removing digits from a string

If that date format is consistent, use substr!

$ perl -E ' > $filename = q{20130101Customer100.imp}; > say $filename; > substr $filename, 0, 8, q{}; > say $filename;' 20130101Customer100.imp Customer100.imp $

Cheers,

JohnGG

Replies are listed 'Best First'.
Re^2: Removing digits from a string
by suneel.reddy (Novice) on Jan 02, 2013 at 08:51 UTC

    Thank you John, thanks a lot...!!! yes - my filename will have a constant format. So,I hope substr works.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1011148]
help
Chatterbox?
[virtualsue]: my view this morning is of a chap stuffing straw in my roof
[virtualsue]: I have 5 days left to finish my slides for LPW
[1nickt]: virtualsue Have you made them tea yet today? (And do you serve Digestives with it?)
[virtualsue]: Lotus biscuits
[Discipulus]: mornign nuns and monks!
[1nickt]: Woah you can get Krispy Kreme doughnut-Lotus Biscoff hybrids!

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (12)
As of 2017-11-20 11:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (286 votes). Check out past polls.

    Notices?