Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Import delimited files 1

Status
Not open for further replies.

cvgalante

MIS
Jun 27, 2002
18
0
0
US
Hi Folks,

Am I missing something or is there no straightforward way to import a delimited text file to a table (like any database product does with ease)? The documentation says the Ttable type ASCII is delimited, but I have only found ways to set it up for fixed width formats. I have used Tstrings with Commatext, but that is more cumbersome than doing, say, a Tbatchmove from ASCII to Paradox or whatever.

If someone knows how to do this, it would save me a lot of processing time. Thanks,

CV
 
CV:
There is an ActiveX component (F1Book) that provides an Excel style spreadsheet. You can import delimited text into that. One problem with my version is that it only handles tab delimited text, so I create a temporary file, searching and replacing with tabs for white space.

F1Book.Read(Filename,F1TabbedText);

Steve
 
CV,

Delphi does provide for comma-delimited files, although it is not very well documented. First you need to create a tTable and define it ttASCII. Next you need to create a SCH (Schema file). The Schema file defines the field names and the type of fields. Search the Borland Developer Network under ASCII Driver with Comma-Delimited Files.

 
Everyone,

Thanks, I found that info about defining ASCII Ttables. Boy, it sure isn't documented anywhere.

Thanks for the help,

CV
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top