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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only