convert paper logs to csv (or whatever) then bulk import?

Problems ? Get help here!
Post Reply
Jeff-in-TX
Posts: 9
Joined: Wed Jul 05, 2017 10:41 pm
Dive Computer: Suunto Zoop

convert paper logs to csv (or whatever) then bulk import?

Post by Jeff-in-TX »

This has undoubtedly been asked and answered but I have been searching for several days now and not hit on the correct search term.
I have about 100 dives on paper that I would like to get into MacDive without doing a manual entry each dive individually -- but that may be my only option, we shall see...

My thought would be to create a spreadsheet and enter the dives into it then convert/export the spreadsheet to a format that MacDive will accept. I know there are lots of import options but I don't know the "column headings" that MacDive wants to see for any of the formats. There is a txt/csv import option but I don't know the headings/format for that either.

My first experiment was to export a manually entered dive (my checkout, Hood Canal, WA in December 1984 - there was snow on the ground) to XML. Then I changed some of the data in the XML file in a way I thought MacDive might accept and then uploaded it. The result was not an additional dive but a mystery site that only shows up in the list of sites, so clearly I did that wrong (made a backup first of course).

I can write something in Python (or whatever) to convert the spreadsheet/csv to an acceptable XML file, but I'd like to know the structure of an importable (no dive computer data) XML dive (or one of the other importable formats) so I can attempt this. What fields are required and which should be left out/blank/"null"?

Of course I'd prefer json, but I won't ask for that. ;)

Is this a new request or has this been discussed ad nauseum and I'm just to search-challenged to find it?

Awesome program by the way. Love it.

Thanks.
User avatar
nick
Site Admin
Posts: 4360
Joined: Sat Apr 12, 2008 8:33 am
Dive Computer: Shearwater Teric
Contact:

Re: convert paper logs to csv (or whatever) then bulk import

Post by nick »

Simple way is manually create one dive with your details, then export that as XML. Now you have a template to work from.

The key thing is to ensure a unique, non null identifier for each dive. Everything else should be pretty straightforward. You can put multiple dives in one XML file as well.

Fee free to email me if you run in to any specific problems but hopefully that is easy enough to work with?

Edit: pretty much what you described doing, but perhaps you didn’t set a new identifier? They need to be unique and MacDive won’t import duplicates.
Jeff-in-TX
Posts: 9
Joined: Wed Jul 05, 2017 10:41 pm
Dive Computer: Suunto Zoop

Re: convert paper logs to csv (or whatever) then bulk import

Post by Jeff-in-TX »

Ahhhh... The identifier. The dive I exported and tried to change and re-load did not have an identifier at all. I deleted it under the (incorrect) assumption that is was assigned by MacDive when imported.

As Maxwell Smart would say "missed it by that much...". :)

The exported dive had this as an identifier:

Code: Select all

<identifier>manual_7AD578B5-F6FD-4C59-A497-9643881C88DE</identifier>
Is the format (like a GUID) important? I can create identifiers that start with manual_ and increment the hex string:

Code: Select all

manual_7AD578B5-F6FD-4C59-A497-9643881C88DF
manual_7AD578B5-F6FD-4C59-A497-9643881C88E0
manual_7AD578B5-F6FD-4C59-A497-9643881C88E1
et cetera...
Will that work?

Also, seeing as how MacDive did not create a new dive when the import was done without an identifier, what exactly did it do?
The mystery site exports like this:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sites SYSTEM "http://www.mac-dive.com/macdive_sites.dtd">

<sites>
    <schema>1.0.0</schema>
    <site>
        <country>USA</country>
        <location>Unknown Location</location>
        <name>Unknown Site</name>
        <bodyOfWater></bodyOfWater>
        <waterType></waterType>
        <difficulty></difficulty>
        <latitude>0.00000</latitude>
        <longitude>0.00000</longitude>
    </site>
</sites>
Thanks!
User avatar
nick
Site Admin
Posts: 4360
Joined: Sat Apr 12, 2008 8:33 am
Dive Computer: Shearwater Teric
Contact:

Re: convert paper logs to csv (or whatever) then bulk import

Post by nick »

Nope, it just has to be unique. What it is doesn’t actually matter.
User avatar
nick
Site Admin
Posts: 4360
Joined: Sat Apr 12, 2008 8:33 am
Dive Computer: Shearwater Teric
Contact:

Re: convert paper logs to csv (or whatever) then bulk import

Post by nick »

Also that’s a site export, not dives?

You can import sites as part of the dive, you don’t need to do it separately. That’s separate functionality if you’re specifically trying to just share sites.
Post Reply