Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
File manipulation
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00273206
Message ID:
00274393
Views:
27
Thanks, but putting it into a table is just an extra step. It works fine as it is.

Michelle


>Michelle
>
>Try this - it's some code that another UT member sent me a while ago (with my modifications) - it opens the text file, then dumps it into a table - you can then do your extraction stuff from the table:
>
>mfilenam = FOPEN("ASCIIFile.DAT")
>USE mytable
>DO WHILE !FEOF(mfilenam)
> cLine=FGET(mfilenam)
> SELECT mytable
> REPLACE mytable.field1 WITH SUBSTR(cLine,1,20),;
> mytable.field2 WITH SUBSTR(cLine,21,20) && Repeat as needed.
>ENDDO
>USE IN mytable
>=FCLOSE(mfilenam)
>
>See ya
>
>Chris
>
>
>>Yeah, that's what I did. I just didn't know how to read from the file.
>>
>>Thanks,
>>
>>Michelle
>>
>>
>>
>>>Michelle
>>>
>>>In the data extraction stuff that we use the SUBSTR() command is really effective:
>>>
>>>For example in your application:
>>>
>>>mstring = '01010212199909380000098463'
>>>?SUBSTR(mstring,1,8) + SUBSTR(mstring,10,6) + SUBSTR(mstring,20,6)
>>>(if I've counted correctly) should make your output look somthing like the stuff below.
>>>
>>>You can also turn the SUBSTR() into a value by using the VAL() command.
>>>
>>>>>>>
>>>>>>>And I need to make it look like this:
>>>>>>>
>>>>>>>01010212990938098463
>>>
>>>
>>>Regards
>>>
>>>
>>>Chris Kable
>>>FuelTrac Pty Ltd
Previous
Reply
Map
View

Click here to load this message in the networking platform