Skip to main content
Question

Passing a Path Filename to JSON reader

  • August 27, 2018
  • 3 replies
  • 241 views

lorinda
Contributor
Forum|alt.badge.img+6

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.

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

lorinda
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • 20 replies
  • August 27, 2018

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.


danilo_fme
Celebrity
Forum|alt.badge.img+51
  • Celebrity
  • 2077 replies
  • August 28, 2018

Hi @lorinda

 

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

Thanks,

Danilo

 


lorinda
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • 20 replies
  • August 29, 2018

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,