Skip to main content
Question

Multiple files to read as a parameter

  • March 6, 2020
  • 2 replies
  • 17 views

fikusas
Contributor
Forum|alt.badge.img+5

Is it possible to read in multiple files from a parameter with FeatureReader? For example:

C:/some_path/fileA.shp

C:/some_path/fileB.shp

SourceDataset parameter value would be: C:/some_path/fileA.shp,C:/some_path/fileB.shp

But this approach doesn't work, it gives an error.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

ebygomm
Influencer
Forum|alt.badge.img+44
  • Influencer
  • 3427 replies
  • March 6, 2020

To pass a list of files as a parameter each filepath would be wrapped in quotes then the list is wrapped in quotes separated by a space

e.g.

""C:\Temp\File1.tab" "C:\Temp\File2.tab"" 

fikusas
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • 75 replies
  • March 6, 2020

Is it possible to get combined paths via private attribute using Python script? I use this code, but it doesn't work:

import os
shapefile = FME_MacroValues['SourceDataset'].split("\" \"", 1)[0].replace("\"\"", "")
return os.path.dirname(shapefile)