Part/substring of a filename

Started by mstief, September 07, 2021, 08:34:07 AM

Previous topic - Next topic

mstief

Hello!

I like to get a substring of a filename.

for example:
  20210104-1234-5678 Text1.jpg
  20210223-3464-3242 Text with Description.jpg


it's easy to get fixed left values:
{File.Name|substr:1,18}   ->  20210104-1234-5678

but I like to have the right part of the name:
  Text1
  Text with Description


I can't find the right solution...
There is no fixed lenght of the name...

thanks for your help.

thrinn

#1
Just let the substr start at character 20 instead of 1.
{File.Name|substr:20} should give you everything starting after the fixed part of your file names.
Thorsten
Win 10 / 64, IMatch 2018, IMA

Mario

I think it's {File.Name|substr:19} (not 29)
This gives you everything following the fixed part at the beginning of your file names.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

mstief

Thanks!

I read the hlep topic about substr many times, but now i noticed there is a example of my problem...
{File.FullName|substr:4}  Extracts the file name after the first four characters. "_DSC1234.RAW" => "1234.RAW"

I think I should read the help more closely...