Home > Archive > Programming with dBASE > February 2006 > text file









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author text file
asif

2006-02-06, 9:23 am

Hi Everyone

ive had a corrupted table and used a hex editor to recover the data into a
text file

all of the data now appears in the txt file, however ther are no carrage
returns it is all in a single line.

is ther any way or program which i can use to add carrage returns so that i
can import the file into a dbase table

Regards Peter


Bowen Moursund [DataTech]

2006-02-06, 1:23 pm

> ive had a corrupted table and used a hex editor to recover the data into a
> text file
>
> all of the data now appears in the txt file, however ther are no carrage
> returns it is all in a single line.
>
> is ther any way or program which i can use to add carrage returns so that
> i
> can import the file into a dbase table


If the 'records' in the text file all are all the same length:

nRecordLen = {whatever it is}
oIn = new file()
oOut = new file()
oIn.open("TheTextFile.txt")
oOut.create("TheOutputFile.sdf")
do
oOut.write( oIn. read(nRecordLen)+chr
(13)+chr(10) )
until not oIn.eof()
oIn.close()
oOut.close()

--
Bowen Moursund
DataTech
Consulting & Development
http://www.bmmnet.us

asif

2006-02-07, 7:23 am

Hi Bowen

Thanks for the reply. Ive tried this and the program runs but only copies 1
record poss something else required on the do loop ?

Regards Peter


Bowen Moursund [DataTech]

2006-02-07, 9:23 am

> Thanks for the reply. Ive tried this and the program runs but only copies
> 1
> record poss something else required on the do loop ?


Change 'until not oIn.eof()' to 'until oIn.eof()'.


--
Bowen Moursund
DataTech
Consulting & Development
http://www.bmmnet.us

asif

2006-02-08, 7:23 am

Hi Bowen

yes that worked great

thanks a lot

sayed me hours of work

regards Peter


Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com