Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Importing from a file with delimiters

Status
Not open for further replies.

ronellmulder

Programmer
Oct 24, 2002
1
US
Firstly, I'm new in Progress - and the helpfile couldn't help. :)

Importing from a file with delimiters:

I have to import from a file - the delimiters might differ from file to file. There is not a standard delimiter. The one file might have *, the next file might have ^ as delimiter.

Currently I find the delimiter - then change it to "*", then use the IMPORT DELIMITER "*" .....

Is there a way to use a varialble in the statement. e.g.
IMPORT DELIMITER v-delim ......

the files are pretty big and I was wondering if a can skip the conversion prosess and just use the delimiter that I find in the IMPORT statement.

This is what I found in the help file:

DELIMITER character

The character used as a delimiter between field values in the file. The character parameter must be a quoted single character. The default is a space character.

They specificly say 'character' and not 'variable' - is there a way around this?

Any help or suggestions would be MUCH appericated!
Thank you
 
You can read in the whole line like:
Prompt-for a1 a2 a3 a4 etc… (I don’t know how many fields)
Find out which delimiter is used.
In our case #
Del=”#”.

Then extract the fields with the entry command like

Aa= a1 + a2 + a3 + a4 etc…

Do x = 1 to num-entries( aa, del):
Fld[x] = entry( x, aa, del).
End.


It will not be very fast.

Regards Gregor

Gregor.Weertman@mailcity.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top