I am using FME to write all the MapInfo TAB files in a directory and it's subdirectories to a File Geodatabase. I'm using dynamic readers and dynamic writers as I don't know the geometry or schema of the input files beforehand. So far so good. Now, suppose that I have a file called
"Pipeline.TAB" at the root of the directory and I have another file called
"Pipeline.TAB" in a subdirectory. No problem. FME can merge the two files together and I get the geometry from both files in my new feature class called
My issue is, suppose those two original files have different attributes. Say, the file in the root folder has a field called "Name" and the second file has a field called
"Pipe_Name". My resulting feature class gets the
"Name" field but not the
"Pipe_Name" field. The features that came from the file in the subdirectory have a NULL value in the
"Name" field. Instead, what I would like is to have both fields come through. I'm happy if the
"Name" field is NULL as long as the
"Pipe_Name" field is there and has the correct values.
It appears that the schema is determined by the first feature that is being read, whereas, I need it to use the schema from all of the features with the same name. Is this possible?
I have posted this question on FMEPedia as well. Here is some additional information which may help:
The example I gave was simple in that it only had two files called Pipeline.TAB. In reality, I'm looking at dozens of folders with thousands of files. there might be 20 files called "Pipeline" and another twenty called "Valves", etc. I won't know the schema of all of them at the start.
What I would like the final attribute table of my destination feature class to look like would be something like this:
Name | Pipe_Name Pipe1 | NULL Pipe2 | NULL Pipe3 | NULL NULL | Pipe 4 NULL | Pipe 5
In the final file, there may actually be many fields. But I won't know all of them at the start:
Name | Pipe_Name | Diameter | Material | Type Pipe1 | NULL | 500 | Steel | Gas Pipe2 | NULL | 1200 | Steel | Gas Pipe3 | NULL | 800 | PVC | Water NULL | Pipe 4 | NULL |NULL | Water NULL | Pipe 5 | NULL |NULL | Water
In response to @BradNesom's answer, I have looked at the SchemaMapper, but I have way too many files to look at for that to be feasible. I also have looked at the other link you mentioned and I tried adding a reader as a resource but that didn't seem to work either.