parsing filename

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
sbrady19
Posts: 337
Joined: 12 Apr 2018, 05:22
Location: Central Florida
Contact:

parsing filename

Post by sbrady19 » 18 Aug 2022, 10:36

here is my code to remove everthing after the search term "_Instrumental_"

Code: Select all

loop,%merge_folder%\*_Instrumental_*.*
{
str := A_loopFilename
INSTRUMENTAL_CUTS .= "`n" . RegExReplace(str, "^(.*)_Instrumental_.*", "$1")
}

UPM_AUPM142_7_Butterfly_Effect_Instrumental_Otto_1664392.wav_Stereo.aif
becomes
UPM_AUPM142_7_Butterfly_Effect

HOW DO I ADD 2 TABS and XXX AFTER REGEX does its thing. Thanks.

UPM_AUPM142_7_Butterfly_Effect XXX

RussF
Posts: 1264
Joined: 05 Aug 2021, 06:36

Re: parsing filename

Post by RussF » 18 Aug 2022, 11:24

Try:

Code: Select all

INSTRUMENTAL_CUTS .= "`n" . RegExReplace(str, "^(.*)_Instrumental_.*", "$1") . "`t`tXXX"
Russ

BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: parsing filename

Post by BoBo » 18 Aug 2022, 15:50

Duplicate request: viewtopic.php?f=76&t=107466
Thread locked.

Locked

Return to “Ask for Help (v1)”