I've tried with this script:
Max(right (FileBaseName(),2)) as MaxFile
Let vMax= Peek('MaxFile');
set vFileName=CMT_'&'$(vMax)'.csv ;
but it did not caught anything from the file.
I cannot understand where the error could be, surely is in the definition of the variable vFileName.
Use this script. It's an assembly of various comments from above:
LOAD Max(Right(FileBaseName(), 6)) AS MaxFile
FROM '*.csv' (txt);
LET vMax = Peek('MaxFile');
DROP Table Temp;
FROM 'CMT_$(vMax).csv' (txt);
If you want to know the value of vMax, just open Settings->Variable Overview... at the end of the script run, and scroll down until you encounter vMax in the variable list.