Re: CSV file and newb

From: Rick Carter (carterrk_at_despammed.com)
Date: 02/03/04


Date: 2 Feb 2004 18:07:13 -0800


"Dave" <wo_lfukNO@SPAMhotmail.com> wrote in message news:<Z8ATb.43724$OA3.13942442@newsfep2-win.server.ntli.net>...
> I have a csv file in the form "name","address", etc how can i read this file
> and assign it to an edit box or format it into a memo in some kind of
> sensible order. I'm using Delphi7 if this makes any difference.

You don't say if that's D7 Personal, Pro, Enterprise, or Architect.
If it's at least Pro, and you have some experience with databases or
are ready
to learn (the learning curve is fairly steep), I believe there's a way
for the BDE to work with text files. Or, there are ways to convert it
to a table; one
is to load the csv file into Excel, insert a first row with headers
(field names), and do a "save as" to a dBASE (.dbf) table.

Other alternatives (also available for Personal): One is to use a
freeware
database engine available from http://www.mylittlebase.org/

Another alternative is to work with StringLists, and particularly to
use
their CommaText property. I have a sample app for using
comma-delimited
text to populate a ListView, and I've also added a way to edit the
data.
I suppose I could zip up and mail you a copy, if you're interested.

Rick Carter
Chair, Paradox/Delphi SIG, Cincinnati PC Users Group