Solved

Ttable and text file

Posted on 1998-08-17
13
503 Views
Last Modified: 2010-04-04
How to use a Ttable to read an ASCII text file with ; as field separator and CRLF as lien separator ?
0
Comment
Question by:nk51
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 6
13 Comments
 

Author Comment

by:nk51
ID: 1337133
I nead examples...
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1337134
Which delphi version?
0
 

Author Comment

by:nk51
ID: 1337135
With Delphi 3.0
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 10

Expert Comment

by:viktornet
ID: 1337136
Hey Zif, how is our site going? I kinda looked at it, but it seems to stay the same. What Mirek's been doing this week?

Regards,
Viktor Ivanov
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1337137
viktornet,
 yes it seems that nobody works on it anymore... this may not happen... I don't know what Mirek is doing this week.
Zif.
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1337138
nk51,

 Do you want to convert ascii-files into a table?
 What do you know?
 - the structure of the ascii-file?
 - ...

 Or can it be anything ?

Zif.

0
 

Author Comment

by:nk51
ID: 1337139
I have an ascii file.
I have a ttable linked to a Paradox table.
I want to put the informations from the ascii file to the Paradox table using Delphi 3.0.
I saw a ttable has a TableType property,
so I think it's possible to use a Ttable to do this operation.
Do you think it's a good way or have you an other solution to my problem ?
Thank you.
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1337140
Hi nk51,

first read this document :

http://www.inprise.com/devsupport/delphi/ti_list/TI2844.html

If it doesn't work like they propose, then you can do the following things :

1. With a KNOW format : read line by line and add the records yourself to a table
2. With an UNKNOWN format : use a component which can transform the file to a table. There are some on the net and Inter has made one also some time ago.

Regards, Zif.
0
 

Author Comment

by:nk51
ID: 1337141
The answer is incomplete regarding the request.
ZifNab give me a part of the answer but it's insufficient for me because I asked how to "link" an ascii text file with a Ttable. The Technical Information 2844 doesn't explain it.
Now, I know how to create a schema file for the ascii driver of the BDE but I don't know how to link it to a Ttable...
A good and complete answer is wanted to receive lots of points (200 points)...
For a very good answer, I give you 500 points.
Thanks

0
 
LVL 8

Accepted Solution

by:
ZifNab earned 100 total points
ID: 1337142
nk51,

Ok, so you need to know how to link it? I thought you already knew this. Perhaps I misinterpreteet your Q'n again, but ok here is my answer :

1. Put a table on the form
2. Change properties :
    - TableType : ttAscii
    - DatabaseName : 'c:\MyProgram\Database\'
      // your directory, or an alias pointing to your directory
    - TableName : 'MyAscii.txt'
      // name of your Ascii file.
       
In code :

 Table1.Active := false;
 Table1.TableType := 'ttASCII';
 Table1.DatabaseName := 'c:\MyProgram\Database\';
 Table1.TableName := 'MyAsciiFile.txt';
 Table1.Active := True;

PS. If your ascii-file has .txt as an extention and TableType is set to ttDefault. BDE, should automatically interprete the file in tablename as an ascii-file.

Regards, Zif.

PS. Is this what you want?

Sorry, if I'm wrong again.
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1337143
nk51,

 Offcourse you can use a datasource to connect to your table and then use the datasource for connecting your file to a dbgrid, etc.

PS. If you just use a small database, i.e. just a small ascii-file, then you can also use this freeware component :

http://home.sprynet.com/sprynet/rrm/qdb.html

It's a database, that doesn't need the BDE (=3 3,5"). With QDatabase you don't need to install the BDE on a clients computer, when you just need a small database.

On the otherhand, if the ascii-file is just for entering new data in a big database, just stick with BDE.

Regards, Zif.
0
 

Author Comment

by:nk51
ID: 1337144
Now, the answer is complete and very satisfactory. You're the expert I thinked ZifNab !!!
Thank you for your effort! You don't regret it !
0
 

Author Comment

by:nk51
ID: 1337145
Now, the answer is complete and very satisfactory. You're the expert I thinked ZifNab !!!
Thank you for your effort! You don't regret it !
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Downloading email attachments 2 96
shape, triangle, dbctrlgrid 3 47
Firemonkey how to swip panel with finger tap 1 42
TlistView is Really heavy on Android 3 44
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question