Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: $trim() not working in File Operations Setup Window (removing " ?") (Read 755 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

$trim() not working in File Operations Setup Window (removing " ?")

Hi,
f2k 1.5b18,

while trying to rename a file with this pattern
Code: [Select]
$puts(F,[%discnumber%][%tracknumber%. ][%artist% - ]%title%[' ('%comment%')']) $trim($cut($get(F),140))
the $trim() does not remove the last space from the resulting filename.

Before renaming: 105. Michel Sardou - Restera-t-Il Encore.mp3
After   renaming: 105. Michel Sardou - Restera-t-Il Encore .mp3  < space before extension

I tried a double $trim($trim($cut... or and extra $trim( around the $get, but that all did not removed the last space, which, IMHO, should be trimmed, because the Title Formatting Syntax Reference says " $trim(A) =>Trims leading/trailing space characters from A."

Please see the screenshots.

Why is the $trim not working here?

Re: $trim() not working in File Operations Setup Window (removing " ?")

Reply #1
Thanks for the report.

The question mark gets stripped by the File Operations component after evaluation of the title formatting, so the $trim() cannot remove the space because at this point the question mark is still there.
Microsoft Windows: We can't script here, this is bat country.