Skip to main content
Question

file path as published parameter for Dynamic Input Reader

  • July 11, 2014
  • 3 replies
  • 39 views

Forum|alt.badge.img
Hello all , 

 

 

I am trying to read all the file paths from a text file which is going to be the source file paths for the dynamic reader . I am using below private variable to generate the source reader's path

 

 

# Get the file from a published parameter

 

ListFile = (FME_MacroValues['Config_File'])

 

f = open(ListFile,'r')

 

featureTypes = ''

 

# Read the file and add each line to the featureTypes Variable

 

featureTypes = f.read()

 

f.close()

 

#Return this list to the parameter

 

return featureTypes

 

 

And I am publishing it to FME Server . When I run the job I am getting error saying it cannot read "C:\\temp1 C:\\temp2 C:\\temp3" .

 

 

Any suggestions ??? 
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.

3 replies

gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • July 11, 2014
Do you feed it individually qouted file/paths?

 

might this be the cause?

Forum|alt.badge.img
  • Author
  • July 11, 2014
Hello Gio, 

 

 

Yes I tried and that worked

 

 

but how can I do the same using python ? 

takashi
Celebrity
  • July 12, 2014
correction for indentations.

 

-----

 

f = open(ListFile, 'r')

 

featureTypes = []

 

for s in f.readlines():

 

    featureTypes.append('"%s"' % s.strip())

 

featureTypes = ' '.join(featureTypes)

 

-----