Skip to main content

Edit Text File parameters

In a
workbench that reads messages from waterway users I will join weather info based
on date and time to those messages. Most off these messages concern cases off
near misses (interaction of ships or ships and infrastructure). Weather info
like wind, winddirection and visibility are important parameters for further
analyses. With a Text File reader I make a connection to our weather institute and
get hour data from the datacenter. So every night I read the messages from the
day before and the idea is to join the weather info from the same day.

In the
source text file one of the parameters is the start date from where the weather
data is read (in this case 20170411 and start hour is 01, see png). So what I want is to
make the start date variable and depending of the actual date, I will only read
the last 2 days of weather data! Is it possible to make the start date variable
in this case?

I use FME
desktop 2015 but will also publish the workspace at FME server!

If possible, I would recommend upgrading to FME 2017.

FME 2017 has a lot of new Date function (calculate the difference between two dates would be the one you need).

Using FME 2015 that is much harder to accomplish.


Can you create the start date in the workspace and then use the attribute within a featurereader to read the data?


The easiest way to get the date two days ago is to create an attribute with the value '2 days ago' and use the date formatter on it. This is simpler than trying to substract from today's date


The easiest way to get the date two days ago is to create an attribute with the value '2 days ago' and use the date formatter on it. This is simpler than trying to substract from today's date

With de dateformatter i can create a date 2 days ago from now (actual date), thats not the problem but how can i use this date in the Text File reader parameters?

 

 


With de dateformatter i can create a date 2 days ago from now (actual date), thats not the problem but how can i use this date in the Text File reader parameters?

 

 

Instead of using a Reader, use a FeatureReader, you can then use the created attribute within this

 

 


Thanks, I tried the feature reader with the created attribute from the dateformatter and it works perfect!


Reply