Skip to main content
Question

? Edit Text File parameters


pschout
Participant
Forum|alt.badge.img+2

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!

6 replies

erik_jan
Contributor
Forum|alt.badge.img+18
  • Contributor
  • April 18, 2017

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.


ebygomm
Influencer
Forum|alt.badge.img+39
  • Influencer
  • April 18, 2017

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


ebygomm
Influencer
Forum|alt.badge.img+39
  • Influencer
  • April 18, 2017

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


pschout
Participant
Forum|alt.badge.img+2
  • Author
  • Participant
  • April 18, 2017
ebygomm wrote:

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?

 

 


ebygomm
Influencer
Forum|alt.badge.img+39
  • Influencer
  • April 18, 2017
pschout wrote:
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

 

 


pschout
Participant
Forum|alt.badge.img+2
  • Author
  • Participant
  • April 18, 2017

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings