Importing excel files into Progrress

Bev McConnell

New Member
Hello Peggers,

Can anyone help me with importing an excel file into progress? I've converted the excel file into a '.txt' and performed a file transfer from the local drive to unix. The problem is the record length exceeds 80 char. It looks as though progress is interpreting the wrap-around char. as seperate records.
How do I get progress to read in the full 160 char. The logic is as follows:

def var x-input as char format "x(160)".

input from "/home/bmcconne/prn/budgettest.txt".

import UNFORMATTED x-input.

x-entity = string(substring(x-input,1,8)).
x-cc = string(substring(x-input,9,8)).
x-desc = string(substring(x-input,25,22)).
x-mon-budget = integer(substring(x-input,60,12)).
x-mon-budget2 = integer(substring(x-input,73,12)).
x-mon-budget3 = integer(substring(x-input,86,12)).

x-mon-budget4 = integer(substring(x-input,98,12)).



(This is followed by a series of 'string' statements to seperate the fields).
 
Originally posted by Bev McConnell
Hello Peggers,

Can anyone help me with importing an excel file into progress? I've converted the excel file into a '.txt' and performed a file transfer from the local drive to unix. The problem is the record length exceeds 80 char.
Bev,

The record length should not matter. It sounds like you have somehow managed to get some erroneous characters into the file when you did the export.

It may be easier if you export the file as csv and do an IMPORT DELIMITER ','.

Hope this helps.
 
If Chris's suggestion of a .CSV file does not do trick, you might also try checking to see if you've some stray chr(13) in the text file. I've been caught by that before and fought it for quite a while before figuring it out. You could look at the file with an editor that will allow you to view carriage returns and the like. Take a look at the character where you line break happens and see if that's what's causing your pain.
Also, I couldn't tell exactly what you did to transfer the file from the DOS world to Unix. But if you didn't use some sort of an FTP program but rather 'cheated' somehow, that's likely your problem. DOS and Unix use different characters for carriage returns. Don't quote me, but I believe DOS uses both 10 and 13, and Unix only uses 10. In any case, what ever the numbers involved, an FTP utility will add and remove chr(13) as the file is moved in or out of the Unix world.

And if none of these things help - well, you're on your own ;)

Mark
 
Based on crittar and MHotovec comments, one more thing you would want to check is, are there any new-line breaks within a cell in the excel file. That could be messing up the file for you.

Thanks
V
 
Back
Top