Viewing 3 posts - 1 through 3 (of 3 total)
- AuthorPosts
- November 30, 2020 at 3:33 pm #27202Display ErrorParticipant
Could someone please help me with a Find & Replace problem?
I’m trying to batch update thousands of .SFZ files by inserting the current file folder name e.g.<region> sample=042_F2.wav pitch_keycenter=f2
becomes:
<region> sample=..\..\..\..\Audio\MULTISAMPLES\(!CurrentFilesFolderName!)\042_F2.wav pitch_keycenter=f2
The relative part remains static but I need to dynamically insert the active file’s directory name somehow.
Is it possible with ‘Find in Files’ & RegEx or should I be approaching this differently?Thank you for any help!
September 19, 2021 at 5:10 pm #27203Display ErrorParticipantAhh, think I’m supposed to use macros… had a go at it but not really sure what I’m doing :/
Gave up and used AutoHotkey with the Textfile & String Library#NoEnv #Persistent Force #SingleInstance Force #Include TF.ahk Loop, Files, E:\SAMPLES\TAL Sampler\Zampler RX\*.sfz, R ; recursively loop sfz files { file := A_LoopFileFullPath ; gets full directory SplitPath file,, dir ; splits out filename SplitPath dir, dir ; splits out last folder name F = !%A_LoopFileFullPath% ; enable file overwriting UpdatedRelativePath = sample=..\..\..\..\Audio\MULTISAMPLES\Zampler\%dir%\ ; path with current folder TF_Replace(F,"sample=", UpdatedRelativePath) ; TF_Replace(Text, SearchText, Replacement="") }
September 19, 2021 at 5:11 pm #27217Display ErrorParticipantAhh, think I’m supposed to use macros… had a go at it but not really sure what I’m doing :/
Gave up and used AutoHotkey with the Textfile & String Library#NoEnv #Persistent Force #SingleInstance Force #Include TF.ahk Loop, Files, E:\SAMPLES\TAL Sampler\Zampler RX\*.sfz, R ; recursively loop sfz files { file := A_LoopFileFullPath ; gets full directory SplitPath file,, dir ; splits out filename SplitPath dir, dir ; splits out last folder name F = !%A_LoopFileFullPath% ; enable file overwriting UpdatedRelativePath = sample=..\..\..\..\Audio\MULTISAMPLES\Zampler\%dir%\ ; path with current folder TF_Replace(F,"sample=", UpdatedRelativePath) ; TF_Replace(Text, SearchText, Replacement="") }
- AuthorPosts
Viewing 3 posts - 1 through 3 (of 3 total)
- You must be logged in to reply to this topic.