Board index » delphi » PROBLEMS WITH TTABLE and ASCII files

PROBLEMS WITH TTABLE and ASCII files

I am having problems getting an Ascii file database into a TTable. I
have read the \delphi\doc\asciidrv.txt and generated a schema file
for a fixed file format. Doing this it would not recognise the
fields.  I copied the example given in aciidrv.txt into
appropriate  files. TTable would not recognise the fields in this
file either.

I would be grateful for any help with the above problem.

Thanks in advance.

Andrew Dow

GeoMEM Software  1 High Street  Blairgowrie  Perthshire PH10 6ET UK
Tel:(44)(0)1250 872284 Fax:(44)(0)1250 873290
email: cent...@geomem.win-uk.net (or sales@, support@, tech@)
Suppliers/developers of scientific & technical software since 1985
Dr. James Tweedie - Software Review Editor - Computers & GeoScience
* Member of the Scottish Internet Business Association (SIBA) *

 

Re:PROBLEMS WITH TTABLE and ASCII files


GeoMEM <cent...@geomem.win-uk.net> wrote in article
<2...@geomem.win-uk.net>...

Quote
> I am having problems getting an Ascii file database into a TTable. I
> have read the \delphi\doc\asciidrv.txt and generated a schema file
> for a fixed file format. Doing this it would not recognise the
> fields.  I copied the example given in aciidrv.txt into
> appropriate  files. TTable would not recognise the fields in this
> file either.

> I would be grateful for any help with the above problem.

> Thanks in advance.

> Andrew Dow

> GeoMEM Software  1 High Street  Blairgowrie  Perthshire PH10 6ET UK
> Tel:(44)(0)1250 872284 Fax:(44)(0)1250 873290
> email: cent...@geomem.win-uk.net (or sales@, support@, tech@)
> Suppliers/developers of scientific & technical software since 1985
> Dr. James Tweedie - Software Review Editor - Computers & GeoScience
> * Member of the Scottish Internet Business Association (SIBA) *

This mail from delphi-talk maight help:

Sorry the file to read is C:\DELPHI\DOC\ASCIIDRV.TXT
Jim
 ----------
From: owner-delphi-talk
To: delphi-talk
Subject: Re: [delphi] Converting text to Paradox
Date: Thursday, January 04, 1996 9:19AM

Read C:\DELPHI\ASCIIDRV.TXT (assuming you did a default install to drive
C).

 This text file is incomplete and inaccurate but serves as a starting
point.

 Some things I have discovered are.

The file says you can use Fixed or Varying file formats.  It's Varying
refers to CSV file layouts where
you have both a separator and a delimiter.  You can specify each.  It will
also build and recognize
DELIMITED if you simply drop either the separator or the delimiter line
from

the SCH file (I don't recall
which line to omit off the top of my head.

Easiest way to build a SCH file is to build a one line application with two
tables and a button.  assign table1 to an existing table and use ttDefault
as tabletype.  Assign table2 to a non-existant text file i.e.
myfile.txt and use ttASCII as tabletype.  Leave both tables closed.  Place
the following line in your button1Onclick event.
  Table2.batchmove(table1,batcopy);

This will build both myfile.txt and myfile.sch.  The file will be Fixed
Column with no separator or delimiter.
At this point you can delete all lines from the text file, alter the SCH
file to describe the type of file you really want i.e change type to
Varying, specify the double quout and comma as separator and delimiter,
alter your button1Onclick code to read
  Table2.batchmove(table1,batappend);

This will update your SCH file so you can both import and export CSV type
files.

You can play with the SCH file and make it handle delimited files provided
your delimiter is a printable ASCII character.  I have not yet discovered
how to use a non printible char (tab) or space.

Beware that you can make lots of mistakes in the SCH file which will result
in GPF's in the ASCII DLL or in truncated data.

If anyone has discovered an accurate document describing ASCIIDRV please
post

Jim Boyce

Other Threads