Skip to main content
Question

file path as published parameter for Dynamic Input Reader


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 ??? 

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
Influencer
  • July 12, 2014
correction for indentations.

 

-----

 

f = open(ListFile, 'r')

 

featureTypes = []

 

for s in f.readlines():

 

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

 

featureTypes = ' '.join(featureTypes)

 

-----

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings