On 19 Jul 2014, at 4:42pm, James K. Lowden <[email protected]> wrote:

> Jonathan Leslie <[email protected]> wrote:
> 
>> What I do is I never use a CSV file as a "Comma separated Values"
>> file but rather as a "Character separated Values"  file, but rather
>> use a Character, ยบ (<alt>0186), a legal character but not one on the
>> keyboard, as the separator character. 
> 
> Better might be to use ASCII as designed.  It defines position 30 as a
> record separator.

I'm clarifying that only to stop someone writing wrong code, not to be annoying.

ASCII 30 is Record Separator.  Use this where you might expect a newline.
ASCII 31 is Unit Separator.    Use this where you might expect a comma.

Files which used these codes (together with 28 and 29) used to be called 
'Control Separated Data' files.  So you used to see files with names like 
SENSOR6.CSD .  In SIXBIT, of course.

By the way, two US characters together indicates a blank field.  But two RS 
characters together does not indicate a blank row.  You carry on as if any 
number of RS together are all one RS.  So you can delete a record without 
having to change the length of a file by replacing all the characters in the 
record with RS.  This was useful when removing the middle of a file could 
occupy a disk or tape drive for 20 minutes.

And yes, I'm old enough that I used to write programs that ran on mainframes 
that used these codes.

Simon.
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to