Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
PRocque1686642795
Contributor
Contributor

JSON Extract numeric keys without attributes

Hello,

I'm having a problem with a JSON file containing weather data. The file is attached. My objective is to extract the data in talend in order to obtain an Excel output file with a timestamp column, an FF column, an LW_D column, an LW_V column, an RR column, an SSI column, a T column, a T_DEW column and a U column.

The problem is that I can't get timestamp values that don't have attributes.

Until now, I've been using a TextractJsonfields but I can't get the timestamp values.

Thanks for your help.

Labels (3)
2 Replies
anselmopeixoto
Partner - Creator III
Partner - Creator III

Hi @Paulin Rocque​ 

 

From what I got, you want to extract the element names like "1685966400" but this JSON format is tricky and I believe it won't be possible with tExtractJsonFields alone.

 

It seems this JSON was designed to be queried for specific timestamps. With that said, I would try to first extract a list of available timestamps from it. Then with that list of timestamps stored in memory you would be able to iterate over the file and query the weather metrics using expressions like $.1685966400 for example.

PRocque1686642795
Contributor
Contributor
Author

Hi, thanks for your feedback,

In fact, the aim is to get the timestamps. And these timestamps are never the same, so it's impossible to call them specifically.

 

But yes, one solution could be to extract only the timestamps first, then the rest of the data. But I haven't managed to do that.