Results 1 to 2 of 2
I have a txt file containing names of files, but they have the address appended to them, which I don't want.
eg.
/path1/file1.dat
/path2/file2.dat
etc.
what is the easiest way ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 06-09-2011 #1Just Joined!
- Join Date
- Dec 2010
- Posts
- 5
removing path prefix from filesnames
I have a txt file containing names of files, but they have the address appended to them, which I don't want.
eg.
/path1/file1.dat
/path2/file2.dat
etc.
what is the easiest way to remove the path from all the filenames in the last?
I don't think that "basename" would be very easy to implement is it only takes on operand at a time.
- 06-09-2011 #2Code:
awk -F "/" '{print $NF}' textfileYou must always face the curtain with a bow.


Reply With Quote
