Page 1 of 1

Wild Card Question

PostPosted: Mon Aug 25, 2014 1:40 am
by TMWalton69
I have a batch of file names that follow this naming convention:

LastName_FirstName_DOB_ParentLastName_ParentFirstName.pdf

I need to remove the Parent Last Name and Parent First Name information from the file names. I can't utilize the Remove Last because all names will vary in character length. Is there anyway to remove characters after the _ by using a wild care or other setting?

Even if I have to take two passes... I need the final file name to be: LastName_FirstName_DOB.pdf
Thanks so much!
Toby

Re: Wild Card Question

PostPosted: Mon Aug 25, 2014 3:46 am
by Admin
Hi, use BRU regular expressions:

RexEx (1)
Match :
(.*)_(.*)_(.*)_(.*)_(.*)
Replace:
\1_\2_\3

Re: Wild Card Question

PostPosted: Mon Aug 25, 2014 6:49 pm
by TMWalton69
Perfection! Thank you so much!