Parse a filename with awk and sed
I have this filename:
06142004_TEST_TEST_Z
And I'm trying to extract the 2004 from 06142004.
I'm able to get 06142004 away from the rest of the filename, but how do I get 2004 from 06142004?
The command I use to get 06142004 is:
ls -l | cut -f1 -d_ | awk '{print $9}'
Any thoughts?
|