Board index » delphi » converting UNIX ascii to .dbf or Paradox format

converting UNIX ascii to .dbf or Paradox format

Hello,

I am trying to convert a Unix ascii file to any format readable by BDE
such as .dbf or .db, any hints??

thanks

Omar

  vcard.vcf
< 1K Download
 

Re:converting UNIX ascii to .dbf or Paradox format


Assuming variable length records, you might try writing a program that will
replace the newlines at the end of the records with cr/lf pairs.  After that
you should be able to import using the BDE text file driver and the
BatchMove component.

--
Bill

Re:converting UNIX ascii to .dbf or Paradox format


Quote
Bill Todd (TeamB) wrote in message <6d1l3e$3...@forums.borland.com>...
>Assuming variable length records, you might try writing a program that will
>replace the newlines at the end of the records with cr/lf pairs.  After
that
>you should be able to import using the BDE text file driver and the
>BatchMove component.

>--
>Bill

Hi Bill
Thanks for your help regarding my problem. I think I have a problem  with my
netscape browser, because I only got your response when I used MS IE4
browser, anyway, I solved the first part of my probelm by doing some reading
in UNIX , So I used the awk command to convert the ascii file to a delimeted
file and it worked fine. The problem now is that when I tried using the
Tbachmove component to convert my file to .dbf I keep getting the message
(Capability not supported - $30 - $1)
I have my .sch file set correctly (I think !! - becuase I copied one from
the help file and changed it) What could be wrong??

Re:converting UNIX ascii to .dbf or Paradox format


I love these really specific error messages<g>.  Since this was a Unix file
the first thing I would look at is the record terminator.  Is the end of a
record marked by a line feed alone or a carriage return/line feed pair.

--
Bill

(TeamB cannot answer questions received via email.)
(To contact me for any other reason remove nospam from my address)

Re:converting UNIX ascii to .dbf or Paradox format


The record terminator CR and LF characters are there, becuase the file is
very well organized and the records are lined up OK, that is each new line
represents a record. I used a third party routine (asctopdx) and changed the
schema file to conform to this routine and it worked fine. Why can;t
tbachmove work?

Re:converting UNIX ascii to .dbf or Paradox format


I have no idea why the BDE ASCII driver will not work in your case.  I would
have to look at the file and there is no point in doing that since you found
a solution.

The BDE ASCII driver is fairly picky about some things.

--
Bill

(TeamB cannot answer questions received via email.)
(To contact me for any other reason remove nospam from my address)

Re:converting UNIX ascii to .dbf or Paradox format


Quote
Bill Todd (TeamB) wrote:
> I have no idea why the BDE ASCII driver will not work in your case.  I
> would
> have to look at the file and there is no point in doing that since you
> found
> a solution.

> The BDE ASCII driver is fairly picky about some things.

> --
> Bill

> (TeamB cannot answer questions received via email.)
> (To contact me for any other reason remove nospam from my address)

I think that the problem is with the BDE configuration, becuase when I
created a new aliase  with a standard configuration, and then I used the
tbatchmove example on the D3 client/server, I got a error message with
"Invalid Object" and that happens when I click on this alias on the
alias list (other aliases work fine), could it be a bug or I am creating
the alias wrongly?

Re:converting UNIX ascii to .dbf or Paradox format


Sorry but I don't know what might cause an "invalid object" error.  I have
never seen or heard of that one before.

--
Bill

(TeamB cannot answer questions received via email.)
(To contact me for any other reason remove nospam from my address)

Re:converting UNIX ascii to .dbf or Paradox format


I mostly working with dbf files, because they are 'very easy' to manapulate.

Except the datefield. Making a dbffile in runtime goes very wel but if I
doing
a post to my table, I get an invalid error of the date field.
This is what I'm  using: " FieldByName('datum').AsString :=
StrToDate('12-05-1997') "

What am I doing wrong?

John Kuiper

ilion Benelux
jo...@ilion.nl

Re:converting UNIX ascii to .dbf or Paradox format


On Mon, 11 May 1998 16:56:37 +0200 John Kuiper <jo...@ilion.nl> said:

--> " FieldByName('datum').AsString :=
--> StrToDate('12-05-1997') "
-->
--> What am I doing wrong?
-->
-->
Try,

FieldByName('datum').AsDateTime := StrToDate('12-05-1997');

--
Jim Fitzgerald - ENVIROGENICS Software Company
Delphi/Visual dBASE/Clipper Development
email replies: chemmast at penn dot com

I hate spammers so send all spam to: ab...@iname.com
Support the anti-Spam amendment - Join at http://www.cauce.org/

Re:converting UNIX ascii to .dbf or Paradox format


On Mon, 11 May 1998 11:12:17 -0400, j...@nomail.com (Jim Fitzgerald)
wrote:

Quote
>On Mon, 11 May 1998 16:56:37 +0200 John Kuiper <jo...@ilion.nl> said:

>--> " FieldByName('datum').AsString :=
>--> StrToDate('12-05-1997') "
>-->
>--> What am I doing wrong?
>-->
>-->
>Try,

>FieldByName('datum').AsDateTime := StrToDate('12-05-1997');

Watch out! This solution may fail too!! The StrToDate will not work if
you've set the date format (in the regional settings of your PC) to
another format than 'dd-mm-yyyy'. Suppose you've set your machine's
date format to 'dd/mm/yyyy', then this will not work!

It is generally a bad idea to pass dates as strings, especially if you
want to transport them from one machine to another. The code as it
stands, may work on one machine and fail completely when you install
it with your customer. If you really must pass a date constant to a
query, then I think you should do it as follows:

FieldByName('Datum').AsDateTime := EncodeDate( 1997, 05, 12 ) ;

because that is totally independent of regional settings. Of course,
if you have the date already in a variable of type TDateTime then you
have no problem. The problem is to get it there.

Hope this helps,
Bart

Other Threads