Skip to main content

Hi all,

 

I have a list of JSON historical file which contains date and time at the end of the URL. I would like to extract both date and time based on the URL and put it in the table.

 

I've extracted the date and time using the DateTimeStamper, but fails as it only generate current date and time.

 

Is there any suggestions on how can I extract the date and time from the URL?

Multiple ways to do this. 

You can use StringReplacers to remove "http://apims.doe.gov.my/data/public_v2/caqm/" and ".json", then covert "2019/09/10/2300" the way you like it with a DateTimeConverter.

As an alternative for the StringReplacers you also can do it in one go using an AttributeCreator and

@ReplaceString(@ReplaceString(@Value(Url),"http://apims.doe.gov.my/data/public_v2/caqm/",""),".json","")

 


Multiple ways to do this. 

You can use StringReplacers to remove "http://apims.doe.gov.my/data/public_v2/caqm/" and ".json", then covert "2019/09/10/2300" the way you like it with a DateTimeConverter.

As an alternative for the StringReplacers you also can do it in one go using an AttributeCreator and

@ReplaceString(@ReplaceString(@Value(Url),"http://apims.doe.gov.my/data/public_v2/caqm/",""),".json","")

 

Thank you @nielsgerrits​. It works!


Reply