trale icon indicating copy to clipboard operation
trale copied to clipboard

Be either more flexible or explicit in data import format

Open ysalmon opened this issue 2 months ago • 2 comments

Is your feature request related to a problem? Please describe. I'm always frustrated when I try to import my data from a self-made CSV file, because I think my file has the same format as what trale exports, yet it does not accept my file (0 entry found) and does not tell me where it fails.

Describe the solution you'd like I would like to get an explanation as to at which interpretation point the import failed : was the CSV delimiter not understood, is it the date format, the weight format ?

This or just accept any reasonable input.

Describe alternatives you've considered I have tried various variants to no avail.

Additional context A line in my file will look like this

2024-08-09T02:00:00 73.40

This is to me a valid timestamp description, followed by a space, followed by a valid float description…

ysalmon avatar Oct 21 '25 10:10 ysalmon

Hi @ysalmon, thank you very much for reporting this issue. I am sorry that you had such a frustrating experience. I have to admit that we are using the built-in dart function to parse the date+time. It does accept a range of different formats, but I have to admit that I do not know which. @gwosd started a big refactoring of the settings page to allow for better descriptions. I guess providing an example string would be a good start, so that the user has a chance to spot the error. The parser itself is written by myself and is rather a mess. I guess we should document on which separators, comments, column names/orders are accepted.

And here is an export from trale: the date should work as well if the time is missing, so only 2025-02-26 70.0. So I guess your examole should work. Could you provide an example text file which fails, so that we can use it for debugging? 2 measurements are sufficient (can also be fake).

# This file was created with trale.
#Date weight[kg]
2025-02-26T06:02:02.517 70.0000000000
2025-02-25T08:54:57.102 70.0000000000

braniii avatar Oct 24 '25 16:10 braniii

Thank you so much for helping me with this. I unfortunately did not keep the files I was using. But using your pattern, I was able to import my data.

ysalmon avatar Oct 24 '25 17:10 ysalmon