More > JRiver Media Center 21 for Windows
Truncating filename / path using expression
jacobacci:
The context of the question is that I am converting FLAC files to m4a.
I have several files that have target path names (incl. the filename) with >259 chars and they are causing problems in FLAC -> m4a conversion.
I am trying to shorten the paths to around 240 chars using the expression language. I have read up on the left, filename etc. functions in the Wiki, but could not find an expression that works. I need to extract the name of the full path (without the file extension), trim that from the right and then put the file extension back on.
I tried
=left(([filename],0),240).flac
and different permutations of this but that didn't quite do the job.
Could anyone suggest an expression? Thanks a lot
marko:
Try:
=left(removeright([filename],5),240).[file type]
jacobacci:
Marko, seems to work brilliantly, thanks a lot
marko:
You're welcome.
jacobacci:
Just one more question, Marko
In the WIKI I found the following:
filename(filepath, include suffix)
The FileName() function returns the file name part of filepath. Inclusion of the file's suffix depends on the include suffix argument.
0 Suppress file suffix
1 Include file suffix
Argument filepath is optional (defaults to [filename]).
Argument include suffix is optional (defaults to 1).
Could the 0 argument be used instead of truncating 5 letters from the right, if there were a mix of different file types, not all 4 letters?
Navigation
[0] Message Index
[#] Next page
Go to full version