Need to remove last 2 sets of data from end of line???

Find, replace, find in files, replace in files, regular expressions

Need to remove last 2 sets of data from end of line???

Postby jibbers » Sat Jun 24, 2006 9:59 am

I'm having trouble using regular expression to remove the last two sets of data from the end of a list of directories. The directories also have different lengths as do the file names if that matters.
eg

aaaa/bbbb/cccc/dddd/123.txt

to leave just

aaaa/bbbb/cccc/

thanks
User avatar
jibbers
Newbie
 
Posts: 2
Joined: Fri Jun 23, 2006 11:00 pm

Re: Need to remove last 2 sets of data from end of line???

Postby mrainey56 » Sat Jun 24, 2006 12:36 pm

Using Unix-style regex.

Search: ([/])[^/]*[/][^/]*$

Replace: \1
User avatar
mrainey56
Master
Master
 
Posts: 212
Joined: Tue Jul 27, 2004 11:00 pm
Location: Spartanburg, South Carolina

Re: Need to remove last 2 sets of data from end of line???

Postby jibbers » Mon Jun 26, 2006 2:35 am

Thanks for the reply, I didnt have any luck using it so I used a simple macro instead, never mind. :D
User avatar
jibbers
Newbie
 
Posts: 2
Joined: Fri Jun 23, 2006 11:00 pm


Return to Find/Replace/Regular Expressions