Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remove everything to the right of the last instance of a character

Status
Not open for further replies.

bmacbmac

IS-IT--Management
Jan 26, 2006
392
US
Hi. I have table with this info:

\\server1\share1\Folder1\County1\Path1\path2
\\server1\share2\Folder2\County2\Path1\path2
\\server1\share3\Folder3\County3\Path1\path2

I would like to remove everything to the right of the 6th '\' so to end up with

\\server1\share1\folder1\county1
\\server1\share2\folder2\county2
\\server1\share3\folder3\county3

Is there a way to do this? I would even just say "remove everything to the right of the last '\'" and then just run it twice if I could even figure out that script.

Any ideas?

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top