Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Sed replacing double quotes/field delimittered in DOS

468 views
Skip to first unread message

dqu...@gmail.com

unread,
Jun 19, 2008, 8:26:00 PM6/19/08
to
I've been struggling with the syntax on this for a while now. I'm
trying to do a pretty common thing in that I want to replace double
quotes from a text file prior to importing it into a database. I've
got the syntax down somewhat, but it will simply not allow me to
search for a single double quote and replace it with nothing.

Below is where I currently stand:
sed "s/\"//g" c:\bcp\pp_master.csv >pp2.txt

this works to the screen, but will not work with the pipe since it
seems to think pp2.txt is a second input file.

This is what I'm trying to do. I've tried so many different
combinations, but none seem to work quite right.

pp_master.csv is a typical csv file, has double quotes around text and
nothing around numbers, etc.

I know this same question has been asked a million times, but it seems
usually it's asked with UNIX in mind, where searching fora double
quote isn't too difficult.

Any help would be greatly appreciated.

foxidrive

unread,
Jun 20, 2008, 12:51:51 AM6/20/08
to
On Thu, 19 Jun 2008 17:26:00 -0700 (PDT), dqu...@gmail.com wrote:

>I've been struggling with the syntax on this for a while now. I'm
>trying to do a pretty common thing in that I want to replace double
>quotes from a text file prior to importing it into a database. I've
>got the syntax down somewhat, but it will simply not allow me to
>search for a single double quote and replace it with nothing.
>
>Below is where I currently stand:
>sed "s/\"//g" c:\bcp\pp_master.csv >pp2.txt

With GNU SED

sed "s/\x22//g" c:\bcp\pp_master.csv >pp2.txt


0 new messages