Skip to main content

Hi There,

i have workspace and trim transformer - Post/processe/Radarsat2/20240313 for example, it should leave 20240313 name of the file, but it remove 2 at the begining, 0240313 remains as file name. How to keep that “2” at the beginning?

 

When I do this I use an AttributeSplitter and a ListIndexer.


There’s also an transformer LastSectionOfStringRemover on Hub that might help you here:

https://hub.safe.com/publishers/safe-lab/transformers/lastsectionofstringremover

(split on / and keep last part)


There’s also an transformer LastSectionOfStringRemover on Hub that might help you here:

https://hub.safe.com/publishers/safe-lab/transformers/lastsectionofstringremover

(split on / and keep last part)

Also the FilenamePartExtractor should work in this case.


Or use a StringSearcher with regular expression \d*$

This will find all digits from the end of the string (or you can use \d{8}$ for exactly the last 8 digits).

 


There’s also an transformer LastSectionOfStringRemover on Hub that might help you here:

https://hub.safe.com/publishers/safe-lab/transformers/lastsectionofstringremover

(split on / and keep last part)

Also the FilenamePartExtractor should work in this case.

Did not know about this transformer, was useful in my case


Reply