Importing Multiple Data Types from File

Dawn M

Member
Progress 9.1
Windows XP

I have a file that contains the following data:

"A" "" "ZZZZZ" "*" "*" ? ? "01 2009" "01 2009" ? ? no yes 10/06/10

This is exactly how a line in the file appears, including the quotes. The question marks represent date values and no and yes represent logical values.

How do I import all these different values? The problem mostly lies with the "01 2009" data field. When I've tried using IMPORT UNFORMATTED with "do i = 1 to num-entries(xline)" it picks up the space in this value and treats "01 as one entry and 2009" as another.

I need to store each value (if there are double quotes, I need to store them) as it's shown in the file.

Thanks!
 
def var t1 as char.
def var t2 as char.
def var t3 as char.
def var t4 as char.
def var t5 as date.
def var t6 as date.
def var t7 as date.
def var t8 as date.
import t1, t2, t3, t4, t5, t6, t7, t8 ....
 

tamhas

ProgressTalk.com Sponsor
If you know the pattern, which it appears you do, you can input directly to the variables and it will handle the quoted bits correctly.
 

Dawn M

Member
Thanks for the replies.

Unfortunately, I don't know how many pieces of data will be on a single line and I don't know their data types.

I can put all the strings into a character array, so I don't have to worry about the data type when I store the data.

Any more ideas?
 

Dawn M

Member
Thanks.

I need to import all data types in as characters. I'm mostly trying to find out how I can import "01 2009", keeping the space in tact.
 
Top