Skip to main content

Hello FMErs,

I am wanting to read a .log file from a specific directory, run it pass a tester on a specific attribute and then output the result in excel file format. I plan to place this on the server for self serve.

example file attached. I had to change the file extension to .txt due to attach rules.

suggestions?

thanks in advance.

You can read the log file with csv reader and use the pipe (the vertical line) as delimiter. No need to change the extension for that, just choose csv reader format.

The attributes wil be created.

Then work from there.


You can read the log file with csv reader and use the pipe (the vertical line) as delimiter. No need to change the extension for that, just choose csv reader format.

The attributes wil be created.

Then work from there.

Thanks gio,

 

thats a start.

 

I need to get the CSV reader to read from the directory the 2 lattest files published there.

 

I have attached a screen shot to give an idea of the requirement.

 

thank you.capture.png

 


Use a Directory and File Pathnames reader to read that directory, make it retrieve the file properties. This includes the attribute path_modified_date, use a DateTimeConverter to change that into a FME Datetime (without offset), a Sorter to sort on that (descending, numeric) and a Sampler to grab the first 2 features. That'll be the 2 most recently modified files in that directory. Then use a FeatureReader, set to CSV, to read them, if you set that up just like @gio suggested you should be good.


Reply