embedded quotes
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 263
- Joined: Fri Sep 23, 2005 6:49 am
embedded quotes
Hi All,
How do I get rid of embedded double quotes and single quotes in the data.
Incoming data: ' '"WASH BAy" SATIN' '
output data: 'WASH BAy SATIN'
Thanks
Mark
How do I get rid of embedded double quotes and single quotes in the data.
Incoming data: ' '"WASH BAy" SATIN' '
output data: 'WASH BAy SATIN'
Thanks
Mark
-
- Premium Member
- Posts: 263
- Joined: Fri Sep 23, 2005 6:49 am
embedded quotes
Is there any unix (AWK) solution available.
Please advice
Thanks
Mark
Please advice
Thanks
Mark
Code: Select all
tr -d \" < file
Code: Select all
awk -v qt='"' ' { gsub(qt,"") } 1 ' file
Code: Select all
sed 's/"//g' file
You are the creator of your destiny - Swami Vivekananda
Code: Select all
sed -e 's/"//g' -e 's/\'//g' file
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
This removes both single and double quotesanbu wrote:Code: Select all
tr -d " < file
Code: Select all
awk -v qt='"' ' { gsub(qt,"") } 1 ' file
Code: Select all
sed 's/"//g' file
Code: Select all
tr -d "\' < file
Code: Select all
awk -v singleQt=\' -v dblQt=" ' { gsub(dblQt,"");gsub(singleQt,"") } 1 ' file
You are the creator of your destiny - Swami Vivekananda