ODBC driver or something no?
I just need to get this data out of these files so i can use it in a new
application.
Please....
Todd Vargo gave you an answer. Did you try it? Does it work? If not, what's
going wrong?
--
Caveman conspiracy theorists!
10 Open "h:customer.dat" For Random As #1
15 FIELD 1, 128 AS IN$
20 Open "customer.txt" For Output As #2
25 R = 1
26 IN$ = SPACE$(128)
40 If EOF(1) Then GoTo 80
50 GET #1, R
55 PRINT IN$
60 PRINT #2, IN$
65 R = R + 1
70 GoTo 40
80 Close
"Auric__" <not.m...@email.address> wrote in message
news:Xns9C6A5C5C4B3Fau...@69.16.185.247...
>Here is the code I finally got to run.
>However when i run it I just get a bunch of blank lines in the txt file...
>
>10 Open "h:customer.dat" For Random As #1
>15 FIELD 1, 128 AS IN$
>20 Open "customer.txt" For Output As #2
>25 R = 1
>26 IN$ = SPACE$(128)
This line changes IN$ from a field to a variable, IIRC.
Try it without.
>40 If EOF(1) Then GoTo 80
>50 GET #1, R
>55 PRINT IN$
>60 PRINT #2, IN$
>65 R = R + 1
>70 GoTo 40
>80 Close
>
>"Auric__" <not.m...@email.address> wrote in message
>news:Xns9C6A5C5C4B3Fau...@69.16.185.247...
>> On Mon, 17 Aug 2009 15:10:54 GMT, Dorian C. Chalom wrote:
>>
>>> I know I asked this before but there must be an easy way for me to
>>> extract data out of GW Basic Random Access data files into a simple text
>>> file format inorder to import into an Access database.
>>>
>>> ODBC driver or something no?
>>> I just need to get this data out of these files so i can use it in a new
>>> application.
>>
>> Todd Vargo gave you an answer. Did you try it? Does it work? If not,
>> what's
>> going wrong?
>>
>> --
>> Caveman conspiracy theorists!
>
--
ArarghMail908 at [drop the 'http://www.' from ->] http://www.arargh.com
BCET Basic Compiler Page: http://www.arargh.com/basic/index.html
To reply by email, remove the extra stuff from the reply address.
>Here is the code I finally got to run.
>However when i run it I just get a bunch of blank lines in the txt file...
>
>10 Open "h:customer.dat" For Random As #1
>15 FIELD 1, 128 AS IN$
>20 Open "customer.txt" For Output As #2
>25 R = 1
>26 IN$ = SPACE$(128)
>40 If EOF(1) Then GoTo 80
>50 GET #1, R
>55 PRINT IN$
And leave this line out, too. Unless you like having your display
somewhat FUBARed.
>60 PRINT #2, IN$
>65 R = R + 1
>70 GoTo 40
>80 Close
>
>"Auric__" <not.m...@email.address> wrote in message
>news:Xns9C6A5C5C4B3Fau...@69.16.185.247...
>> On Mon, 17 Aug 2009 15:10:54 GMT, Dorian C. Chalom wrote:
>>
>>> I know I asked this before but there must be an easy way for me to
>>> extract data out of GW Basic Random Access data files into a simple text
>>> file format inorder to import into an Access database.
>>>
>>> ODBC driver or something no?
>>> I just need to get this data out of these files so i can use it in a new
>>> application.
>>
>> Todd Vargo gave you an answer. Did you try it? Does it work? If not,
>> what's
>> going wrong?
>>
>> --
>> Caveman conspiracy theorists!
>
Thank you.
<ArarghMai...@NOT.AT.Arargh.com> wrote in message
news:rq1j85psaj6fotj0h...@4ax.com...
>OK great it looks alot better but I do not think the record length is
>correct how can i determine the record length?
Find the field statements in the original source, and count. :-)
If you don't have the source, put the file somewhere where I can get
it, and I will tell you.
Also, remember that, AFAIK,GWbasic uses MSfloat format floating point
numbers. You will need to use QBasic or some version of QuickBasic to
actually convert the files.
> On Mon, 17 Aug 2009 12:46:51 -0400, "Dorian C. Chalom"
> <DCh...@Comcast.net> wrote:
>
>>OK great it looks alot better but I do not think the record length is
>>correct how can i determine the record length?
> Find the field statements in the original source, and count. :-)
>
> If you don't have the source, put the file somewhere where I can get
> it, and I will tell you.
>
> Also, remember that, AFAIK,GWbasic uses MSfloat format floating point
> numbers. You will need to use QBasic or some version of QuickBasic to
> actually convert the files.
He posted a file to this group Thursday, presumably the data file. Look for
msgid: uSJFrzEH...@TK2MSFTNGP05.phx.gbl
--
Independence limited.
I don't see attachments to posts in this group, else I would have
looked.
Thanks anyway.
Here is the record length and code for each file posted. If you would like
to remove the junk from each file, remove the "; JUNK$" from line 60.
supplier.dat = 300 characters
10 OPEN "supplier.dat" FOR RANDOM AS #1 LEN = 300
15 FIELD 1, 118 AS IN$, 182 AS JUNK$
20 OPEN "customer.txt" FOR OUTPUT AS #2
25 R = 1
40 IF EOF(1) THEN GOTO 80
50 GET #1, R
60 PRINT #2, IN$; JUNK$
65 R = R + 1
70 GOTO 40
80 CLOSE
driver.dat = 200 characters
10 OPEN "driver.dat" FOR RANDOM AS #1 LEN = 200
15 FIELD 1, 118 AS IN$, 82 AS JUNK$
20 OPEN "driver.txt" FOR OUTPUT AS #2
25 R = 1
40 IF EOF(1) THEN GOTO 80
50 GET #1, R
60 PRINT #2, IN$; JUNK$
65 R = R + 1
70 GOTO 40
80 CLOSE
quotes.dat = 100 characters
10 OPEN "quotes.dat" FOR RANDOM AS #1 LEN = 100
15 FIELD 1, 56 AS IN$, 44 AS JUNK$
20 OPEN "quotes.txt" FOR OUTPUT AS #2
25 R = 1
40 IF EOF(1) THEN GOTO 80
50 GET #1, R
60 PRINT #2, IN$; JUNK$
65 R = R + 1
70 GOTO 40
80 CLOSE
--
Todd Vargo
(Post questions to group only. Remove "z" to email personal messages)
As an example for the file: 'Driver.dat', here is a program to read the
random file and output a text file with a field per line and a separator
( - - ) between records.
10 OPEN "DRIVER-1.TXT" FOR OUTPUT AS #2
20 OPEN "DRIVER.DAT" FOR RANDOM AS #1 LEN = 200
30 FIELD #1, 5 AS H$, 30 AS N$, 30 AS A$, 30 AS C$, 23 AS L$, 48 AS J$,
34 AS HA$
40 FOR I = 1 TO 73
50 GET #1, I
100 WRITE #2, H$
110 WRITE #2, N$
120 WRITE #2, A$
130 WRITE #2, C$
140 WRITE #2, L$
150 WRITE #2, HA$
160 WRITE #2, " - - "
170 NEXT
180 CLOSE #1
190 CLOSE #2
999 END
This same program can be easily modified for the other data files, or
for a different output format.