Hi @lifalin2016,
I believe this post can to help you Use PythonCller to get list of files in Directory
Thanks,
Danilo
Hi @lifalin2016,
I believe this post can to help you Use PythonCller to get list of files in Directory
Thanks,
Danilo
Thanks danilo_fme.
I originally fetched the data manually, and read them from my HDD instead.
However, I just revisited all my unanswered question, and decided to test the FTP Python code.
It took awhile to get it to work, though, but it does now.
Unfortunately one still needs to download multiple files to get a single dataset for FME to read (ESRI Shape, MapInfo TAB etc.), but at least it's now automateable.
Cheers.
Hi @lifalin2016,
I believe this post can to help you Use PythonCller to get list of files in Directory
Thanks,
Danilo
Here's the Python code in case someone else wants to tinker:
import fme
import fmeobjects
import ftplib
class FeatureProcessor(object):
def __init__(self):
pass
def input(self,feature):
pass
CSVlist = e]
_ftp = ftplib.FTP("ftp.safe.com")
_ftp.login() #anonymously
_ftp.cwd("fmebuilds")
try:
CSVlist = _ftp.nlst()
except ftplib.error_perm, resp:
if str(resp) == "550 No files found":
print("No files found")
else:
pass
#raise
_ftp.quit()
pass
for i,v in enumerate(CSVlist):
_var = "_list_CSVs{{{}}}".format(i)
feature.setAttribute(_var, v)
self.pyoutput(feature)
def close(self):
pass