Skip to main content

Hello,

please, I have one problem to solve. Is it possible to change filename extension in FME? E.g. I need to change filename "Analysis.doc" to "Analysis.docx" automatically in workspace. Probably some Python script is suitable there... Unfortunately, I´m not Python expert.

Could anybody help me please?

Thak You so much!

Lubo

You can do this using the filecopy writer in fme


Or you can use the SystemCaller to use the DOS copy command.


You can do this using the filecopy writer in fme

 

An example of reading all the .doc files in a directory, using the filecopy writer to create .docx followed by a system caller to delete the original

 

 


Or you can use the SystemCaller to use the DOS copy command.

I'd recommend the REN command (rename) rather than copy.

 

 


Hello @erik_jan, @egomm and @redgeographics,

Im not sure, if REN command in SYSTEMCALLER can help me... Probably, I should be more specific - I need to convert file with extension ".svg.gz" to special extension ".svg+px". Is it possible via REN command please?


If you need to manipulate a filename in an attribute (as opposed to the name of an actual file), there's also the FilenamePartExtractor which lets you split a path and/or filename into its individual parts.


If you need to manipulate a filename in an attribute (as opposed to the name of an actual file), there's also the FilenamePartExtractor which lets you split a path and/or filename into its individual parts.

Probably it is not what I really need. Or am I wrong? I simply need rename the source file (e.g. C:\\Temp\\ABC.svg.gz) to destination file (C:\\Temp\\ABC.svgz+px). I think that I´m not able to do that via FilenamePartExtractor...

 

 


Probably it is not what I really need. Or am I wrong? I simply need rename the source file (e.g. C:\\Temp\\ABC.svg.gz) to destination file (C:\\Temp\\ABC.svgz+px). I think that I´m not able to do that via FilenamePartExtractor...

 

 

The FilenamePartExtractor will split up an attribute value (a string, basically) containing a filename, thereby allowing you to "re-construct" that filename to something else.

 

 

It won't touch the file, however. So if you need to rename an actual file, then no, the FilenamePartExtractor won't to that for you, unless you use it in conjunction with e.g. the FILECOPY writer, as suggested by @egomm

 


Thanks to all of you!


Reply