Skip to main content
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_MacroValuesV'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 ??? 
Do you feed it individually qouted file/paths?

 

might this be the cause?
Hello Gio, 

 

 

Yes I tried and that worked

 

 

but how can I do the same using python ? 
correction for indentations.

 

-----

 

f = open(ListFile, 'r')

 

featureTypes = ]

 

for s in f.readlines():

 

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

 

featureTypes = ' '.join(featureTypes)

 

-----

Reply