Thanks to both Nino and Simon, for those prompt answers, which
confirmed that my question was indeed stupid. Why inserting newlines
did not work when I tried to insert them I'm not completely sure; I
repeatedly got syntax errors. I reproduced Simon's example now, which
worked fine (and my suspicion is actually that I simply forgot the
closing parenthesis - which the Elisp function certainly wouldn't do -; 
sorry about the unnecessary hassle; I should at least have posted
my attempt).

Thanks very much also for pointing to the hex() and the cast()
functions; that was very interesting.

Which leads me to the motive for my question: parsing the line
output. I remember having read that this output mode has been designed
to be easily parsable by programs. The algorithm I have been using
thus far works perfectly, except for the tiny embarassment that any
literal newline in the values would make a hell of a mess of
everything. (It simply splits the output first at double newlines
(into records), then at single newlines (into single cells)).

Of course I can think of a number of solutions, including using hex()
on all columns, to avoid the newline issue. But I would be curious if
(or rather, I would be anything else but surprised) smarter solutions
are already around, perhaps even some which don't sidestep the newline
issue. Is parsing really as tricky as I think when values may contain
any number of newlines?

Many thanks for any input!

Florian

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to