Need Help with Import Delimiter

apple

New Member
Howdie!

I need to contain into specific variables each data taken from the imported file with a tab delimiter. How can I work it out? :confused:

Here's the code I created:
Code:
define work-table wrkfile
    field srcid     as char
    field destid    as char
    field accode    as char
    field d_dial    as char
    field authcode  as char
    field s_time    as char
    field cdur      as char
    field c_cost    as decimal format '>>,>>9.99'
    field acc_code  as char.
 
INPUT FROM VALUE(cfullname).
   REPEAT:

    create wrkfile.
    import delimiter "~011" wrkfile.

   END.
   INPUT CLOSE.
 
FOR EACH mytt:
OUTPUT STREAM mystr TO VALUE(myfile) APPEND.
EXPORT STREAM mystr DELIMITER "~t"
mytt.
OUTPUT STREAM mystr CLOSE.
END.

INPUT FROM VALUE(myfile).
REPEAT:
CREATE mytt1.
IMPORT DELIMITER "~t" mytt1.
END.
INPUT CLOSE.


This will work.

You can also give "~011"
 
I'm not sure I fully understand what you want. The basic thing with the import statement is that it will receive the stuff from the file in the order in the text file to the fields of the temp-table in the order they are defined. So you program would expect the file to be srcid(tab)destid(tab)accode(tab)... If the file's not in that format you can either tweak the file or the order the temp table is defined.

If you're getting a specific problem, then try and explaing it, including your Progress version and any error messages.
 
Back
Top