I'm trying to rename thousands of model files that are numbered inconsecutively, and in multiple groups, to be in a single consecutive numbering order. To further complicate things, each model has one or more texture files that need to be renamed to match. I'm fairly certain the only solution in BRU is Javascript, but I have almost no experience with Javascript and I don't see any variables in the help file that I could use the check if a number already exists. Also I have no idea how one would separate different parts of the filename with Regex to work with them separately.
Here's an example:
- Code: Select all
//models:
mp_f_freemode_01^accs_003_u.ydd -> mp_f_freemode_01_mp_f_clothes_01^accs_000_u.ydd
mp_f_freemode_01^accs_004_u.ydd -> mp_f_freemode_01_mp_f_clothes_01^accs_001_u.ydd
mp_f_freemode_01^accs_013_u.ydd -> mp_f_freemode_01_mp_f_clothes_01^accs_002_u.ydd
mp_f_freemode_01_female_freemode_business^accs_004_u.ydd -> mp_f_freemode_01_mp_f_clothes_01^accs_003_u.ydd
//textures:
mp_f_freemode_01^accs_diff_003_a_uni.ytd -> mp_f_freemode_01_mp_f_clothes_01^accs_diff_000_a_uni.ytd
mp_f_freemode_01^accs_diff_003_b_uni.ytd -> mp_f_freemode_01_mp_f_clothes_01^accs_diff_000_b_uni.ytd
mp_f_freemode_01^accs_diff_003_c_uni.ytd -> mp_f_freemode_01_mp_f_clothes_01^accs_diff_000_c_uni.ytd
mp_f_freemode_01^accs_diff_004_a_uni.ytd -> mp_f_freemode_01_mp_f_clothes_01^accs_diff_001_a_uni.ytd
mp_f_freemode_01^accs_diff_004_b_uni.ytd -> mp_f_freemode_01_mp_f_clothes_01^accs_diff_001_b_uni.ytd
mp_f_freemode_01^accs_diff_004_c_uni.ytd -> mp_f_freemode_01_mp_f_clothes_01^accs_diff_001_c_uni.ytd
mp_f_freemode_01^accs_diff_013_a_uni.ytd -> mp_f_freemode_01_mp_f_clothes_01^accs_diff_002_a_uni.ytd
mp_f_freemode_01^accs_diff_013_b_uni.ytd -> mp_f_freemode_01_mp_f_clothes_01^accs_diff_002_b_uni.ytd
mp_f_freemode_01_female_freemode_business^accs_diff_004_a_uni.ytd -> mp_f_freemode_01_mp_f_clothes_01^accs_diff_003_a_uni.ytd
mp_f_freemode_01_female_freemode_business^accs_diff_004_b_uni.ytd -> mp_f_freemode_01_mp_f_clothes_01^accs_diff_003_b_uni.ytd
mp_f_freemode_01_female_freemode_business^accs_diff_004_c_uni.ytd -> mp_f_freemode_01_mp_f_clothes_01^accs_diff_003_c_uni.ytd
mp_f_freemode_01_female_freemode_business^accs_diff_004_d_uni.ytd -> mp_f_freemode_01_mp_f_clothes_01^accs_diff_003_d_uni.ytd