I惴 trying to read a Tab delimited file with Delphi 5.
I found a very easy sample in the Internet ,but unfortuantelly it seems it愀 not for Delphi 5.
http://delphi.about.com/od/delphitips2007/qt/tab_delimited.htm
The question is,What愀 the better way to import a TXT Tab delimited file with Delphi 5?
Regards,
Marcello Dias
Marcello,
If you've only got Delphi5 then you probably don't have
"tStringList.LoadFromFile", so you'll probably have to parse the input
lines yourself.
But look on the bright side - At least you will have saved all the time
you would have wasted trying to persuade "LoadFromFile" to accept that
large, tab-separated Excel file (with its multiple-line fields and
idiosyncratic use of quotes)
I see my CsvImporter only takes about 300 lines (counting *lots* of blank
lines and comment lines) and that handles both comma and tab separated
files, multi-line text fields, and multiple quote characters
--
Paul Scott
Information Management Systems
Macclesfield, UK.
>I see my CsvImporter only takes about 300 lines (counting *lots* of blank
>lines and comment lines) and that handles both comma and tab separated
>files, multi-line text fields, and multiple quote characters
>
And is it in Public Domain? :]}
Marcello
> The question is,What4s the better way to import a TXT Tab delimited
> file with Delphi 5?
If your confident your data wont contain commas you could load into 1
stringlist, do search/replace for #9 to , and then copy the text into
commatext (I think it is) for d5, and work from there.. Shouldnt be
that much slower.
--
Liz the Brit
Delphi things I have released: http://www.xcalibur.co.uk/DelphiThings
Not needed anymore
Excelent JVCL TJVcsvDataSet does the JOB.
Regards,
Marcello Dias
I'm using Delphi 7 and a Stringlist to parse lines from a tab-
delimited text file. However, anytime 2 or more consecutive tabs
appear in a row, they're treated as a single delimiter. Is this by
design? If so, how do I get around it? TIA
Teri