Depending on how you want to use the information, you could also create a
Content Map (and XML document) for the file and then use a tool like "grep"
to count the number of occurrences of Vdata (Tables) and Vgroups (Groups) in
the Map.

You can find the h4mapwriter distribution, and more information about HDF4
File Content Maps, at 
http://www.hdfgroup.org/projects/h4map/

In general you would do something like:

$ h4mapwriter file.hdf file.hdf.map.xml
$ grep "h4:Table name=" file.hdf.map.xml > file.Vdata
$ wc -l file.Vdata
21 file.Vdata
$ grep "h4:Group name=" file.hdf.map.xml > file.Vgroups
$ wc -l file.Vgroups
4 file.Vgroups

You can also look at the content of file.Vgroups or file. Vdata or
file.hdf.map.xml to see more about the objects in the original HDF4 file.

$ cat file.Vgroups
        <h4:Group name="L2_Support_atmospheric&amp;surface_product" path="/"
class="SWATH" id="ID_G1">
            <h4:Group name="Geolocation Fields"
path="/L2_Support_atmospheric&amp;surface_product" class="SWATH Vgroup"
id="ID_G2">
            <h4:Group name="Data Fields"
path="/L2_Support_atmospheric&amp;surface_product" class="SWATH Vgroup"
id="ID_G3">
            <h4:Group name="Swath Attributes"
path="/L2_Support_atmospheric&amp;surface_product" class="SWATH Vgroup"
id="ID_G4">

The link above will also take you to the schema for the Map files.

If you want to use the number of Vdata & Vgroups programatically, the HDF4
APIs are probably the way to go.  If you just want to find out what's in the
file, mapping it or using an HDF4 utility like "hdp" may be worth exploring.

-- Ruth


--
View this message in context: 
http://hdf-forum.184993.n3.nabble.com/Groups-Vdata-tp3752747p3753604.html
Sent from the hdf-forum mailing list archive at Nabble.com.

_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

Reply via email to