Import Data Separated With A Tilde

DRAMQ

New Member
I am having problems importing a text file that has about 2k records with 22 fields separated with a tilde ("~").

1. I have pre defined a temp table "tt" with all 22 fields.
2. I run the following code:
repeat:
create tt.
import delimiter "~~" tt.
end.
And it does not import all the records. I cannot see a pattern
to the records it skips.
3. The text file opens just fine in Excel delimited with "~".

Any suggestions? Thanks.
 
What O/S is Progress on.

DRAMQ said:
I am having problems importing a text file that has about 2k records with 22 fields separated with a tilde ("~").

1. I have pre defined a temp table "tt" with all 22 fields.
2. I run the following code:
repeat:
create tt.
import delimiter "~~" tt.
end.
And it does not import all the records. I cannot see a pattern
to the records it skips.
3. The text file opens just fine in Excel delimited with "~".

Any suggestions? Thanks.
 
I'm sure it can't be this easy, so I must be missing something.
But why do you have two tildes in quotes, rather than just one?
I would expect the line to be
import delimiter "~" tt.
not
import delimiter "~~" tt.

Mark
DRAMQ said:
I am having problems importing a text file that has about 2k records with 22 fields separated with a tilde ("~").


1. I have pre defined a temp table "tt" with all 22 fields.
2. I run the following code:
repeat:
create tt.
import delimiter "~~" tt.
end.
And it does not import all the records. I cannot see a pattern
to the records it skips.
3. The text file opens just fine in Excel delimited with "~".

Any suggestions? Thanks.
 
I wish it were that easy. When I take one tilde out I get an error
message (133) when I try to compile it.

"Make sure that all quotes are matched. If they appear to be, look for
include {} files that might contain quotes, or for parameters {n} that
might not have been passed as expected. Also, make sure that all open
quotes are preceded by a blank, and that all close quotes are followed by
a blank."

Thanks for your help.

MHotovec said:
I'm sure it can't be this easy, so I must be missing something.
But why do you have two tildes in quotes, rather than just one?
I would expect the line to be
import delimiter "~" tt.
not
import delimiter "~~" tt.

Mark
 
I tried that as well, and had no success. Thanks.
I think we are going to have to do some type of
character replace through a unix command from
"~" to ";". I replaced all the "~" with ";" and it
worked fine.

cecsno said:
Then try "\~".
 
I just wrote a program involving a text file that was delimited with ~ (in Unix). My suggestion:

define var xfield-1 as character no-undo.
define var xfield-2 as character no-undo.

/* Define fields for the maximum number of data elements you're importing */

define stream TEST.

input stream TEST from....

repeat:

import stream TEST delimiter "~~"
xfield-1
xfield-2...

create tt-temp-table.
assign tt-temp-table.field-1 = xfield-1
tt-temp-table.field-2 = xfield-2...

end. /* repeat */

input stream TEST close.

This worked for me. If it still doesn't work, try running your file through quoter.


DRAMQ said:
I tried that as well, and had no success. Thanks.
I think we are going to have to do some type of
character replace through a unix command from
"~" to ";". I replaced all the "~" with ";" and it
worked fine.
 
For some reason this does not work either. Thanks for help on this.
I have tried everything. I would think that something is wrong with
the data, but when I change the "~" symbol to ";" in the data it
works fine. I wonder if this is a progress set-up issue or maybe a
Unix environment issue.

Dawn M said:
I just wrote a program involving a text file that was delimited with ~ (in Unix). My suggestion:

define var xfield-1 as character no-undo.
define var xfield-2 as character no-undo.

/* Define fields for the maximum number of data elements you're importing */

define stream TEST.

input stream TEST from....

repeat:

import stream TEST delimiter "~~"
xfield-1
xfield-2...

create tt-temp-table.
assign tt-temp-table.field-1 = xfield-1
tt-temp-table.field-2 = xfield-2...

end. /* repeat */

input stream TEST close.

This worked for me. If it still doesn't work, try running your file through quoter.
 
Back
Top