1752803 Members
5877 Online
108789 Solutions
New Discussion юеВ

Re: shell script help

 
SOLVED
Go to solution
Muthukumar_5
Honored Contributor

Re: shell script help

You can try as,

# echo "arpt_356789.dbf" | sed 's/^.*_//;s/\..*$//'
356789

# echo "arpt_356789.dbf" | perl -pe 's/^.*_//;s/\..*$//'
356789

hth.
Easy to suggest when don't know about the problem!
Seth Parker
Trusted Contributor

Re: shell script help

Here's one with just the cut command:

$ echo arpt_356789.dbf | cut -f2 -d"_" | cut -f1 -d"."
356789
$
joinsiva
Advisor

Re: shell script help

thanks all

it worked.

sivakumar p.