Re: Importing Dive Data from a CSV file

2016-09-23 Thread Miika Turkia
On Fri, Sep 23, 2016 at 9:28 PM, Anton Lundin  wrote:
> On 22 September, 2016 - Nick wrote:
>
>> Hi, I have some old dive data in an Excel spreadsheet that I want to import
>> into SubSurface, but am having some problems with some of the data. I have a
>> number of dives that are longer than 60 minutes, and these are held in the
>> CSV file in HH:MM:SS format. One dive for example is 1:09:00 (69 minutes)
>> but when importing the duration is showing as 1m09s.
>>
>>
>>
>> How can I import these correctly?
>>
>
> You can rewrite your time to be on the format MM:SS , ie 69:09. That
> a working workaround.
>
>
> There is a bug in the csv import code. As far as i can read the bug is
> at xslt/csv2xml.xslt:99

This parser is used when there is a dive profile included. The XSLT
used when there is one line per dive is manualcsv2xml.xslt.

> 
>
> To me that looks very much like "Take minutes and seconds, and don't
> care about anything else. Also substring in xslt is 1-indexed, so we
> throw away something in the beginning. Sense this makes none.

This field is for start time, not duration and there is an additional
1 before the true time as otherwise time might be interpreted as
octal. And that must be skipped :D

> Miika: Am i just reading it wrong or how is this ment to work?

Yep, you are reading wrong field. In this case, duration is passed
as-is to Subsurface to be parsed. I just sent a patch to change the
duration from h:m:s format to m:s format, so it will be parsed
properly.

miika
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: Importing Dive Data from a CSV file

2016-09-23 Thread Anton Lundin
On 22 September, 2016 - Nick wrote:

> Hi, I have some old dive data in an Excel spreadsheet that I want to import
> into SubSurface, but am having some problems with some of the data. I have a
> number of dives that are longer than 60 minutes, and these are held in the
> CSV file in HH:MM:SS format. One dive for example is 1:09:00 (69 minutes)
> but when importing the duration is showing as 1m09s.
> 
>  
> 
> How can I import these correctly?
> 

You can rewrite your time to be on the format MM:SS , ie 69:09. That
a working workaround.


There is a bug in the csv import code. As far as i can read the bug is
at xslt/csv2xml.xslt:99 



To me that looks very much like "Take minutes and seconds, and don't
care about anything else. Also substring in xslt is 1-indexed, so we
throw away something in the beginning. Sense this makes none.


Miika: Am i just reading it wrong or how is this ment to work?


//Anton


-- 
Anton Lundin+46702-161604
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Importing Dive Data from a CSV file

2016-09-22 Thread Nick
Hi, I have some old dive data in an Excel spreadsheet that I want to import
into SubSurface, but am having some problems with some of the data. I have a
number of dives that are longer than 60 minutes, and these are held in the
CSV file in HH:MM:SS format. One dive for example is 1:09:00 (69 minutes)
but when importing the duration is showing as 1m09s.

 

How can I import these correctly?

 

Many thanks for any help you can give.

 

Nick

___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface