realbasic-nug
[Top] [All Lists]

Re: CSV DatabaseCursor question

To: REALbasic Network Users Group <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: CSV DatabaseCursor question
From: Matthias Buercher <reader at belle-nuit dot com>
Date: Thu, 31 Jan 2002 03:38:25 +0200
>One option might be to pick up the string, use ReplaceAll
>to replace all occurrences of "," with a tab ie  chr(9). Then import it into
>your table or what ever using NthField.

1) this still leaves the quotes at the beginning and the end of the line
2) it does not cover mixed CVS records where some fields are in quotes 
and others aren't.
3) the file may be slightly lousy formatted for example as ", "

i think you have to parse through the line and track opening and closing 
quotes. maybe you can also trim an nthfield at the beginning (to remove a 
space) and then if it starts with a quote, you start the next field only 
after the closing quote.

matthias


-----------------------------------------------------
matthias buercher  belle nuit montage  fax 4112742114
matti at belle-nuit dot com        http://www.belle-nuit.com   
-----------------------------------------------------



<Prev in Thread] Current Thread [Next in Thread>