I’m new to FME.
How do you rename a source_file (MapInfo.Tab) and copy it to another folder using a Filecopy writer? I've seen similar questions to this but I still don't know how to do it.
I managed to replicate the Filecopy following the instructions here: https://knowledge.safe.com/articles/How_To/Including-files-dynamically-in-a-data-download-result .However, I want to rename my MapInfo tab file (which I am copying with the Filecopy) and I’m not able to do this.
This is what my process looks like:
The source table is named Car_Parking.Tab and I want it to be CARPARKING.Tab in the output folder. Landmark is copying fine and I don’t need to change the name. These two are part of a bigger workbench which copies many files.
For now Car_Parking.* is copying as Car_Parking.* to my output. I did try various things -changing the _filename_part in an attributecreator, Fanout options (I managed to create a CARPARKING folder )- Creating a Path and file name reader... etc- but nothing worked.
I saw in some FME community answers " @Value" was added in the Attributecreater but I couldn't associate @Value to CarParking.
Here’s the process for the CarParking Tab file:
- Creator: - Creation Instance Attribute: _creation_instance
- AttributeCreator: AttributeName = source_fileValue = H:\\CoreData\\Places\\Car_Parking.*
- AttributeFileReader: - Destination Attribute:_file_contents – Source Filename: H:\\CoreData\\Places\\Car_Parking.Tab – source File Character Encoding: Binary (fme-binary)
- FilenamePartExtractor: -Source Attribute: source file – Desired Filename Part: Full Filename – Target Attribute: _filename_part
- AttributeCreator: - AttributeName: destination_file – Value: $(Path)\\$(Places) -AttributeName:filecopy_source_dataset –Value:source_file
- Attributecopier:-Source Attribute:Source_file -Target Attribute:filecopy_source_dataset
-Source Attribute: _filename_part -Target Attribute:filecopy_dest_filename
- filecopy
Dianne