• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Extracting information from a HDF5 file and placing it in a file for querying

 
Ranch Hand
Posts: 31
Firefox Browser Fedora Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi there,

I have a number of HDF5 files and would like to extract information from them and then dump it into a format that I can then query. I was wondering if a CSV file would be suitable. Would I be able to select rows 1 to 10000 and analyse variable number x from each row in this format?

Questions
1) What is the best way in Java to extract information from a HDF5 file and dump it into another format.
2) Which format would allow me to easily select variables from a number of rows.

I found the HDF5 website very unhelpful for Java and the code I am currently using to work with the HDF5 files is extremely inefficient.

Thanks to all who reply,

TS
 
Marshal
Posts: 27211
87
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I see that HDF5 has two different Java interfaces. I don't know anything about either of them but I would start by investigating them.

As for what data format to use so that you can query it, I would suggest a database. SQL is designed to be queried.
 
Tom Storm
Ranch Hand
Posts: 31
Firefox Browser Fedora Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I had a look at SQL but received a number of errors when using the code I have to extract the information from the HDF file. However I have found CSV files and have another little issue. I receive an arrayoutofbounds exception with the current code. What am I doing incorrectly?



Thanks for the earlier response.

TS
 
Bartender
Posts: 1166
17
Netbeans IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tom Storm wrote:I had a look at SQL but received a number of errors when using the code I have to extract the information from the HDF file. However I have found CSV files and have another little issue. I receive an arrayoutofbounds exception with the current code. What am I doing incorrectly?



I'm with Paul on this and believe you should be using JDBC/SQL.

There are two obvious places in your code (nextLine[9] and nextLine[32]) that could result in an ArrayOutOfBounds exception and you will be able to tell if you print the stack trace associated with the exception.
 
Tom Storm
Ranch Hand
Posts: 31
Firefox Browser Fedora Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I managed to fix the exception by looping through files in a directory rather than combining them into a single cvs.

Thank you for your replies.

TS
 
Did Steve tell you that? Fuh - Steve. Just look at this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic