Saving a CSV with the following format in iPhone application -
in application have simple logbook user can save simple posts event. format this:
date, duration(seconds), distance(km), comment , categories variable number between 0 - 4 , circumstances/conditions variable number between 0 - 4
an example be:
header of csv file
date,duration,distance,comment
then multiple rows this
07.02.11,7800,300,"a comment"
07.02.11,7800,300,"a comment"
07.02.11,7800,300,"a comment"
but how can add categories , conditions format , how know in categories/conditions end in csv if @ later point in application want import file again?
(i not need how save etc file, done that, need guidiance on how format it, thank you)
(this seems pretty odd)
header of csv file
date,duration,distance,comment, category, category, category, category, condition, condition, condition, condition
then multiple rows this
07.02.11,7800,300,"a comment", "categoryname", "categoryname", "categoryname","categoryname", "condtion", "condition", "condtion", "condition"
(would better)
header of csv file
date,duration,distance,comment, category, condition then multiple rows this
07.02.11,7800,300,"a comment", "multiple category names separted -", "multiple condition names separted -"
i think last proposal of separating conditions or categories using special separator symbol (the hyphen in example) right one. way suggest 2 things:
use less common separator, can forbid user use without limiting user choice; hyphen character don't want forbid, use different sequence such 3 pipes: ||| not common.
if possible (but careful in case final destination of csv file) can avoid using standard "comma separator". reason if comma used inside fields content, content must separated double quotes. time problematic if need custom parsing other software. when know csv not used source import other software (e.g. numbers or excel) prefer use different separator, e.g. sequence of 2 hash (##) or more "strange". note in case no more strict-csv compliant! there software, openoffice, more flexible special formats.
Comments
Post a Comment