Skip to main content

I'm attempting to filter through all the files within a specific location to identify what shapefiles and feature classes exist within that location (dealing with over 500,000 files). I'm using a Directory and File Pathnames reader to kick off the workflow which is recognizing that there are zip folders within the location, but stops at the zipped folder and won't read the files within them.

 

Is there a way for me to read in the files from the zipped folders as well?

 

Thanks!

You can use the Schema (Any Format) reader to parse the zipfiles and find all shapefiles and feature classes within them. If you're pointing it to a zip make sure to have it read filename.zip\\*.* rather than filename.zip


I would use a FeatureReader executing the second PATH reader.

Send file paths whose extension is zip to a FeatureReader. In the FeatureReader, set the second PATH reader as Format, and set "@Value(path_unix)/*.*" to the Dataset parameter, as in:

featurereader-paremeters


I would use a FeatureReader executing the second PATH reader.

Send file paths whose extension is zip to a FeatureReader. In the FeatureReader, set the second PATH reader as Format, and set "@Value(path_unix)/*.*" to the Dataset parameter, as in:

featurereader-paremeters

Thanks for your suggestion! I tried this initially and couldn't get it to work, but revisited it after your comment and it seems to be working now. One thing I noticed though is that the path_windows changes from where the file is actually located to a temporary file location on the C: drive - any ideas why this is changing? I would like to be able to export the file path of the actual file using the path_windows. Thanks again for your help.


You can use the Schema (Any Format) reader to parse the zipfiles and find all shapefiles and feature classes within them. If you're pointing it to a zip make sure to have it read filename.zip\\*.* rather than filename.zip

I gave this a shot and couldn't quite achieve what I was hoping for. Using a FeatureReader transformer and a second PATH reader seems to do the job. Thank you for your suggestion!


Thanks for your suggestion! I tried this initially and couldn't get it to work, but revisited it after your comment and it seems to be working now. One thing I noticed though is that the path_windows changes from where the file is actually located to a temporary file location on the C: drive - any ideas why this is changing? I would like to be able to export the file path of the actual file using the path_windows. Thanks again for your help.

That's because when FME reads from a zipfile it unzips that to a temporary location first.


Reply