Dear community
As per another post, I am desparately trying to salvage my diving data that was first trusted to Scubaearth.com and next to Diviac, https://logbook.diviac.com/home/. Even paid for an enterprise subscription but the service is showing signs of being in a death struggle (right now you cannot see details for your dives, the SSL certificate expired and it took weeks for it to be renewed. The uploader has not been updated for months and a lot more). So I am trying to migrate the data into Subversion. In that way I have some control of them.
It turns out, Diviac saves dive profile data in a native format. I was able to export some of it before the service entered its current state of paralysis. It looks like this:
[
[0, 1.5, 20.0, ["surface"], null],
[10, 2.94, 20.0, [], null],
[20, 4.53, 20.0, [], null],
[30, 7.27, 20.0, [], null],
[40, 10.24, 20.0, [], null],
[50, 12.56, 20.0, [], null],
....
]
First param is <number of seconds into dive>, second is <depth in metres> and third is <temperature in degrees C>, fourth is some kind of event like "surface". Fifth, I do not know, and I do not need, it think.
I think it should be easy to translate that format into the XML format used by Subsurface:
<depth max='3.62 m' mean='1.909 m' />
<temperature air='20.0 C' water='19.0 C' />
<extradata key='Serial' value='72870300' />
<event time='0:00 min' type='25' flags='2' name='gaschange' cylinder='1' o2='32.0%' />
<event time='0:00 min' type='9' name='surface' />
<event time='1:07 min' type='9' name='surface' />
<event time='2:23 min' type='8' name='bookmark' />
<event time='3:59 min' type='9' name='surface' />
<sample time='0:00 min' depth='1.52 m' />
<sample time='0:10 min' depth='2.93 m' temp='20.0 C' />
<sample time='0:20 min' depth='3.55 m' />
....
The question is this: Does anyone have a suggestion on what parser to use to interpret the format with the many square brackets used by Diviac? I could probably write a parser in Perl using Regular Expressions but if it is a well-known format then there is no point in spending a full day writing and debugging such a parser.
Yours
Claus, Denmark