Skip to main content

I'm attempting to dynamically map 141 different excel files containing attribute names (but no attributes) to the corresponding files that contain the actual attributes. There are 51 different files (.txt files in csv format) containing attributes for the 141 "schema" files, so a total of 7191 files containing data - none of which have attribute names in them (they all come in as col0, col1, col2...). Because there are 141 different schemas and because there might be new schemas added over time, I don't want to manually map the attribute names using an AttributeManager or AttributeRenamer. Also, they can change each year, so manually creating a schema file to use in a schema mapper doesn't make sense (the schema file containing the attribute names is horizontal, not vertical as well). I have been trying to use the FeatureReader to map the attribute name files to the attribute value files, as well as the FeatureWriter but I'm not having any success. Does anyone have any suggestions for manipulating either of those transformers or others that might be helpful. Or any other suggestions. Thanks.

Could you insert the schema row of attribute names into the first row of the .txt files? With a text reader, you can read the whole file at once, then write out to a different txt file first the feature containing the attribute names row, the second feature containing the rest of the text file. Then read it back in as a complete csv file.


Could you insert the schema row of attribute names into the first row of the .txt files? With a text reader, you can read the whole file at once, then write out to a different txt file first the feature containing the attribute names row, the second feature containing the rest of the text file. Then read it back in as a complete csv file.

That is kind of what I'm leaning toward. That, or using an AttributeTransposer from FME HUB to help write out the schema to a file and then pulling everything together. I was just hoping to be able to do it without having multiple workspaces. I'm already up to 3 with this process, but I might have to just suck it up! Thank you for helping me brainstorm. I really appreciate it.


Reply