Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cobol and VFP
Message
 
To
30/07/1998 00:02:50
Anderson Girardi
Athenas Automação de Escritório
Porto Alegre, Brazil
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00122575
Message ID:
00122636
Views:
13
>Thanks Craig Berntson.
>
>I know how use fopen, fread, etc...., but how i will do the importation of data?
>Do you can help me?

Anderson,
as Craig stated once you have read a record into a variable you must parse the fields from this
e.g.

RecordLength = 100 && or whatever.

hand = fopen('coboldata')
myrec = fread(hand,RecordLength)

first_name = subst(myrec,1,20)
second_name = subst(myrec,21,20)
etc...etc..
You can either create a table of the correct structure first and then use insert into tablename from memvar, or write the parsed fields to a deliimited file,
e.g.
hand2 = fcreate(outfile)

myrec = first_name +"'" + second_name + chr(13) && to add a carriage return
fwrite(hand2,myrec,len(hand2))

Regards
Pete Kane
Regards,
Peter J. Kane



Pete
Previous
Reply
Map
View

Click here to load this message in the networking platform