Building a bash script. I need to process a large text file with the following sample lines:
./00300000/10000/9000/319981-4.jpg
./00300000/10000/9000/319981-1.jpg
./00300000/10000/0000/310058-1.jpg
./02000000/00000/4000/2004784-1.jpg
./02000000/00000/4000/2004299-1.jpg
./02000000/00000/4000/2004784-4.jpg
./02000000/00000/4000/2004784-3.jpg
I wish to extract just a substring of the filename portion of each line to end up with
319981
319981
310058
2004784
2004299
2004784
2004784
Any _simple_ combination of grep | sed | awk would suffice.
For extra credit: I also need to remove duplicates and sort!