Hi @makshmellow,
I simulated here your case with a folder and it was contained 6 files .PNG.
The transformer AttributeManager was used to add a prefix ( SAFE_ ) in the attribute fme_basename:
The Writer FILECOPY was inserted in my Workspace and the mode = Move.
workspace-add-prefix.fmw
Attached the Workspace
Thanks,
Danilo
Hi @makshmellow, you can use a Directory and File Pathnames (PATH) reader and a File Copy writer to add a common prefix to all JPG file names, which are saved under a specific directory and its subfolders.
- Add a PATH reader and a File Copy writer for the same Dataset (a directory that contains subfolders containing JPG files) to the workspace, configure the reader/writer parameters as shown in the screenshots. You can also modify the parameters via the Navigator window after adding the reader and writer, if necessary.
On the Canvas, connect between {the PATH reader feature type and the File Copy writer feature type}, {source file path ('path_unix') and 'filecopy_source_dataset'}, and {source directory path ('path_directory_unix') and 'filecopy_dest_dataset'}. With a Windows machine, 'path_windows' and 'path_directory_windows' are also available.- In the File Copy writer feature type, set a string concatenating your desired prefix and 'path_filename' (i.e. original file name) to 'filecopy_dest_filename' (destination file name).
That's it.
Note: Since it would be so troublesome to restore the original file names if it failed, it would be strongly recommend to make a backup of the root directory and its descendant folders/files beforehand.
Hi @makshmellow,
I simulated here your case with a folder and it was contained 6 files .PNG.
The transformer AttributeManager was used to add a prefix ( SAFE_ ) in the attribute fme_basename:
The Writer FILECOPY was inserted in my Workspace and the mode = Move.
workspace-add-prefix.fmw
Attached the Workspace
Thanks,
Danilo
Hi Danilo,
I can not seem to find the workbench, would you mind reuploading it?
Thanks in advance.