Crosswalk table for renaming?

Bulk Rename Utility How-To's

Crosswalk table for renaming?

Postby jplacy2 » Fri Mar 26, 2021 10:44 pm

I'm hoping somebody can provide guidance on the following. I have a folder full of files that look like the following:

ortho_1-1_hc_s_wi001_2020_1.sdw
ortho_1-1_hc_s_wi001_2020_1.sid
ortho_1-1_hc_s_wi001_2020_1.sid.aux.xml
ortho_1-1_hc_s_wi001_2020_1.txt
ortho_1-1_hc_s_wi001_2020_1.xml
ortho_1-1_hc_s_wi003_2020_1.sdw
ortho_1-1_hc_s_wi003_2020_1.sid
ortho_1-1_hc_s_wi003_2020_1.sid.aux.xml
ortho_1-1_hc_s_wi003_2020_1.txt
ortho_1-1_hc_s_wi003_2020_1.xml
ortho_1-1_hc_s_wi005_2020_1.sdw
ortho_1-1_hc_s_wi005_2020_1.sid
ortho_1-1_hc_s_wi005_2020_1.sid.aux.xml
ortho_1-1_hc_s_wi005_2020_1.txt
ortho_1-1_hc_s_wi005_2020_1.xml

Each file contains a specific code that I want to replace with a new string. So for example, I need to replace wi001 with "Adams," wi003 with "Ashland," and wi005 with "Barron." I have about 75 total pairs to replace. I thought the "rename pairs" functionality in BRU was the ticket, i.e.:

wi001,Adams
wi003,Ashland
wi005,Barron
wi007,Bayfield
wi009,Brown
... and so on.

But I'm not finding a way to actually apply this. Admittedly, I may be completely missing the mark with "rename pairs."

Can anyone give me a push in the right direction? Am I on the right track?

Thanks!
jplacy2
 
Posts: 1
Joined: Fri Mar 26, 2021 10:28 pm

Re: Crosswalk table for renaming?

Postby Luuk » Sat Mar 27, 2021 12:07 am

Greetings, the "rename pairs" is for the whole "filename.ext", but there is at least three ways to conduct like this...

Im thinking the easiest is probably using Special(14) and putting the checkmark in 'Character'.
So then a window does present itself, so you can paste something like...
w,i,0,0,1=A,d,a,m,s
w,i,0,0,3=A,s,h,l,a,n,d
w,i,0,0,5=B,a,r,r,o,n
w,i,0,0,7=B,a,y,f,i,e,l,d
w,i,0,0,9=B,r,o,w,n

Another way can be using the Replace(3) with a 'Replace' and 'With' like...
wi001|wi003|wi005|wi007|wi009
Adams|Ashland|Barron|Bayfield|Brown

Another way can be using the RegEx(1) with a checkmark in 'v2', then a 'Match' and 'Replace' like...
wi001(?X)wi003(?X)wi005(?X)wi007(?X)wi009
Adams(?X)Ashland(?X)Barron(?X)Bayfield(?X)Brown

The RegEx(1) can be more customized, but Im thinking the first two ways is probably good enough, and easier too.
Also, if to use these examples in the future for smaller words, its best to include the underscores.
So like in this case, only changing words like _wi001_, but not _kiwi001_.
Luuk
 
Posts: 693
Joined: Fri Feb 21, 2020 10:58 pm


Return to How-To