Question

Passing a Path Filename to JSON reader

  • 27 August 2018
  • 3 replies
  • 21 views

Badge +5

Hi,

I've found how to get the latest file from a directory and get the file name. I now need to pass this file name to a JSON reader. I'm having difficulties in doing this. I realize that the FTP Watcher in Server would be my best bet, but unfortunately we don't have FME Server available. I will be using another program to download the json files from the FTP server. Then using PATH with Sorter and Sampler to get the latest file. I've tried to use the Feature Reader setting it to JSON with the pathfilename , but must not have the proper items set up as of yet as it rejects what I've entered. This data is ultimately to merged with a feature dataset to map specific points based on one column that is unique between the two.


3 replies

Badge +5

Got past the file name. It was actually the path_windows that I needed. Now I need to figure out how to get the json file read. Have added the JSONFormatter as the file is in all one line. It is rejected out of the Feature Reader, but the Inspector is giving no obvious clues as to why.

Userlevel 4
Badge +30

Hi @lorinda

 

Could you share us the Workspace and Log file to investigate better?

Thanks,

Danilo

 

Badge +5

For the most part the script is running as I want it to now.

I have gotten the latest file, and have gotten it copied to a standard name. (PATH > Sorter > Sampler, 1 > filecopy). However, I have the PATH reader set as the first item in my workbench, but it is running after the readers for the json file (which is to read the filecopy) and the attachment feature class. I really need this PATH reader to run first to find the latest json script to be processed. This will be running approximately every 30 mins.

Ideally, the better solution would be to use Creator > Feature Reader, PATH > Sorter > Sampler, 1 > Feature Reader, JSON > then process have the PATH reader with sorter and sampler supplying the latest file name to the JSON reader.

Thanks,

Reply