linux - Remove quotes sed -
i have file thousands of records pipe delimited each field enclosed quotes. need read line , write line quotes removed new file. correct sed command run correctly? installed sed on windows machine keep
[input]
"first name"|"last name"|"address"|"city"|"state"|"zip"
[output]
first name|last name|address|city|state|zip
commands have tried separately neither of them work
c:\program files\gnuwin32\bin>sed 's/\"//g' "c:\users\abc\documents\testfile.txt" > quoteoutput.txt c:\program files\gnuwin32\bin>sed s/\"//g "c:\users\abc\documents\testfile.txt" > quoteoutput.txt"
% echo '"first name"|"last name"|"address"|"city"|"state"|"zip"' | sed -e 's/"//g' first name|last name|address|city|state|zip
you needn't escape "
unless delimiter.
[edit show how run under windows]
echo 's/"//g' > c:\users\abc\documents\test.sed' sed -f c:\users\abc\documents\test.sed c:\users\abc\documents\quotefile.txt > "c:\users\abc\documents\quotefileprocessed.txt"
Comments
Post a Comment