Where to put in $replace

Hi all

Jeg har copied this code from another .nfo:
$loop($num(%discnumber%,3)$num(%track%,4)%_filename_ext%)$num(%track%,2). %title%$repeat( ,$sub(57,$len(%title%))) [$replace(%length%,,:)]
$loopend()

I need to put this in
$replace(%title%,Å,Aa,å,aa,Æ,Ae,æ,ae,Ø,Oe,ø,oe,)

I can get it to work with:
$loop($num(%discnumber%,3)$num(%track%,4)%_filename_ext%)$num(%track%,2). $replace(%title%$repeat( ,$sub(57,$len(%title%))),Å,Aa,å,aa,Æ,Ae,æ,ae,Ø,Oe,ø,oe,) [$replace(%length%,,:)]
$loopend()

But then I mess up the aligenment with the %lenght% is moves the extra char if say Ø is replaced with OE.

How to I get about this? Thank you.

Yes, exactly: use $put and $get to save the result of the $replace() function and recycle it where you need it:

$loop($num(%discnumber%,3)$num(%track%,4)%_filename_ext%)$puts(aa,$replace(%title%,Å,Aa,å,aa,Æ,Ae,æ,ae,Ø,Oe,ø,oe,)) $num(%track%,2). $get(aa)$repeat( ,$sub(57,$len($get(aa)))) [$replace(%length%,,:slight_smile:]
$loopend()

Thank you very much! :slight_smile:

Here is an export script proposal to modify it to your needs, if ever, ...

$filename($getEnv('USERPROFILE')'\desktop\MusicBits.txt',UTF-8)
$loop($num(%discnumber%,3)$num(%track%,2)%_path%)$num(%track%,2)'. '$left($replace(%title%,'Å','Aa','å','aa','Æ','Ae','æ','ae','Ø','Oe','ø','oe')$repeat($char(32),57),57)' : '[$replace(%_length%,'_',':')]
$loopend()

DD.20170622.2100.CEST

Abit problems. Now the brackets don't show [] - quote ' is replaced with Å.

I cant find the error.

QUOTE (DetlevD @ Jun 22 2017, 21:00) <{POST_SNAPBACK}>
Here is an export script proposal to modify it to your needs, if ever, ...
$filename($getEnv('USERPROFILE')'\desktop\MusicBits.txt',UTF-8)
$loop($num(%discnumber%,3)$num(%track%,2)%_path%)$num(%track%,2)'. '$left($replace(%title%,'Å','Aa','å','aa','Æ','Ae','æ','ae','Ø','Oe','ø','oe')$repeat($char(32),57),57)' : '[$replace(%_length%,'_',':')]
$loopend()

DD.20170622.2100.CEST

Nice, thank you. :slight_smile: