Skip to main content
My shp are grouped into folders and I'd like to use the folder name (no spaces) and the date file created of the SHPs in my attribute table.

 

 

I have about 50 group folders and an average of 1-50 shps per folder.

 

 

I'm trying to write my output into one feature class inside a file geodatabase.

 

 

I have already used schema reader to handle the multiple folders and mutiple shps, I can;t figure out how to use the directory and file path reader.

 

 

Also is there a way to connect multiple feature types into one writer. The total number of feature types that are read by the Feature reader is almost 1,500 shapefiles.
You can use a FeatureMerger to add the file path attribute from the File and Directory Path reader to your shape files, merging where fmebasename(shp) and path_rootname match.

 

 

Alternatively, you could expose the fme_dataset format attribute on the shp reader.

 

 

To connect multiple feature types, use a 'single merged feature type' reader, and write using a dynamic writer, taking the schema sources from the input shapefiles.
Thanks Owen!

 

 

Everything you said worked for me, except the dynamic feature type writer. The output appears in the Inspector and the feature writing appears successful.  However, I can;t find my feature class.

 

 

I added a DateFormatter (for null dates and Char date values), FilenamePartExtractor (for folder name attribute) and attempted a SchemaMapper because of data that fail the process when there are duplicate columns - really weird on this one folder. I wasn't too successful with the SchemaMapper though.

 

 

Hope you have other ideas on the output. Will appreciate that very much.
A dynamic writer works in a similar way to 'fan out by attribute' except it automatically creates an output file for each input file, matching the schemas, plus any new user attributes you add.

 

 

So you should have the same number of output files - check the location of the destination directory in the navigator.

Reply