Replaceing Double Quotes [message #164516] |
Thu, 23 March 2006 15:25 |
tbone231
Messages: 2 Registered: March 2006
|
Junior Member |
|
|
Hello
I have a file like this:
"JOHN","SMITH","123 STREET","ATLANTA","GEORGIA"
"MARY","SMITH","23 "E" STREET","ATLANA","GEORGIA"
The issue I'm having is that I want to read in the 3rd field as my address one field, but the cases where I have a double quote is causing issues.
Above the "E" is causing an issue
I want to write a replace command, but I can't get my syntax to work.
Here is what I am trying:
STREET_ADDR1 CHAR(30) "REPLACE(:STREET_ADDR1,'"' ')",
So I load --23 E STREET-- instead of --23 "E" STREET--
I've tried a number of other combos but I can't get this double quote replace syntax correct.
Can someone point me in the right direction?
Thanks!
|
|
|
|
Re: Replaceing Double Quotes [message #165891 is a reply to message #164516] |
Mon, 03 April 2006 03:50 |
nmacdannald
Messages: 460 Registered: July 2005 Location: Stockton, California - US...
|
Senior Member |
|
|
Try dumping the data to a <file>.txt cut and paste to something like textpad on XP, then do a replace to get out the double quotes.
start vi back on the server.
put vi in insert mode(i). Paste from the <file>.txt file that was modified. Put the data back into the database from the modified <file>.txt file.
|
|
|
Re: Replaceing Double Quotes [message #165959 is a reply to message #164516] |
Mon, 03 April 2006 12:13 |
|
Barbara Boehmer
Messages: 9102 Registered: November 2002 Location: California, USA
|
Senior Member |
|
|
I assume that you are using:
optionally enclosed by '"'
which would cause it to think that the " before the E is the end of the field. If you eliminate the optional enclosure, then you can use something like:
STREET_ADDR1 CHAR(30) "REPLACE(:STREET_ADDR1,chr(34), '')"
but you would have to do that for every column.
|
|
|