Skip to main content

I want to read csv files with different schemas but with some attributs which are part of all csv files:

file1in: attribute1, attribute2, attributeA, attributeB, attributeC

file2in: attributeD, attributeE, attribute1, attribute 2, attributeF, attributeG

Then I want to do some processing and write the files with some additional attributes to new files:

file1out: attribute1, attribute2, attributeA, attributeB, attributeC, attributeX, attributeY

file2out: attributeD, attributeE, attribute1, attribute 2, attributeF, attributeG, attributeX, attributeY

File names for output are the filenames of input with additonal postfix like "_transformed":

<filename1in> => <filename1in>+"_transformed" (<filename1out>

How can I do this? I have tried to use a csv writer with dynamic properties but then I get resulting filenames of "CSV". If I change the feature type names from "format names" to "file names" in the csv reader, then I get the filenames but I loose the original attributs from the input csv files.

Anyone has an idea how to solve this?

Best regards,

Frank

Create an attribute (ex _filename) that is fme_basename_transformed.

 

On the csv writer set the file name to that attribute, but set the Schema definition name to fme_feature_type (not default from CSV name).

 

In the User attributes tab add the additional attributes you created.

 

 


Hello Joanna!

Thank you for your hint! Simple and works for me :-)

Best regards,

Frank

 


Reply