Hi All,
I have a text file with the following text in it:
file:///About/accessibility.html
file:///About/disclaimer.html
file:///About/disclaimer.html#disclaimer
file:///pubmed?term=%22Dacre%20I%22%5BAuthor%5D
file:///pubmed?term=%22Madigan%20J%22%5BAuthor%5D
http://www.facebook.com/ncbi.nlm
http://www.nlm.nih.gov/privacy.html
I want to delete all the text that occurs before the last /. This means, my output should look like this:
accessibility.html
disclaimer.html
disclaimer.html#disclaimer
pubmed?term=%22Dacre%20I%22%5BAuthor%5D
pubmed?term=%22Madigan%20J%22%5BAuthor%5D
ncbi.nlm
privacy.html
I tried this using two different commands after searching this forum but I think I am making some mistakes:
These are the commands that I issued:
perl -p -e 's/^.*?//' 1.txt
and
sed 's/^.*/\/\//' 1.lin
I am using Linux with Bash.