Irfan Sayed wrote:
Hi All,
Hello,
I have a string like this "pqp-un_1.0G_2009-02-23_17-38-09_5678903.txt
" now what i need is only all digits before .txt till first underscore.
which means i need only output as 5678903
$ perl -le'
$_ = "pqp-un_1.0G_2009-02-23_17-38-09_5678903.txt ";
print;
$_ = ( split /\D+/ )[ -1 ];
print;
'
pqp-un_1.0G_2009-02-23_17-38-09_5678903.txt
5678903
John
--
Those people who think they know everything are a great
annoyance to those of us who do. -- Isaac Asimov
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/