How I can do it?

A swapping-ground for Regular Expression syntax

How I can do it?

Postby Santy4Tas » Fri Mar 23, 2018 4:50 am

Hello dear people,

I'm here because I need your help, I need to bulk rename some file with certain conditions but I don't know how.

I have a list of files with the following names:

TEST 10-3A NAME
TEST 10-3B NAME
TEST 10-3C NAME
TEST 10-3D NAME
TEST 10-3E NAME
TEST 10-3F NAME
TEST 10-3G NAME
TEST 10-3H NAME

I Need to replace the "10-3X" (the X is the variable, the different letter) for a new word. So I need to change the "10-3" word INCLUDING the following letter for each "10-3", in this case A, B, C, D......

How I can do it? :( I hope you can help me with this problem!

Thank you so much!
Santy4Tas
 
Posts: 3
Joined: Fri Mar 23, 2018 4:37 am

Re: How I can do it?

Postby Santy4Tas » Fri Mar 23, 2018 8:02 am

I already did it!

Now I have another question.

I have various RegEx codes with the Match and the Replace codes.

How I can apply various RegEx commands to a group of files?

Thanks! :)
Santy4Tas
 
Posts: 3
Joined: Fri Mar 23, 2018 4:37 am

Re: How I can do it?

Postby Santy4Tas » Fri Mar 23, 2018 8:30 am

Santy4Tas wrote:I already did it!

Now I have another question.

I have various RegEx codes with the Match and the Replace codes.

How I can apply various RegEx commands to a group of files?

Thanks! :)


These are the RegEx expresions I made for my requirement

Command 1:
Match: (.*) 10-1[A-Z] (.*)
Replace: \1_REF_\2

Command 2:
Match: (.*) 10-9[A-Z] (.*)
Replace: \1_TAXI_\2

Command 3:
Match: (.*) 10-2[A-Z] (.*)
Replace: \1_ARRIVAL_\2

Command 4:
Match: (.*) 10-3[A-Z] (.*)
Replace: \1_DEPARTURE_\2

Command 5:
Match: (.*) 11-\d (.*)
Replace: \1_APPROACH_\2

I have a group of files and I need to apply all of this codes in this order to that files, how I can do it just in one time? There is a way to convert this commands in just one javascript command?

Thanks!
Santy4Tas
 
Posts: 3
Joined: Fri Mar 23, 2018 4:37 am


Return to Regular Expressions


cron