tr to remove " from a file
Im trying to use tr to remove all " from a file and output to a new file. Ive tried the literal, wrapping in single ' etc.. its not as easy as I thought it would be.
sed 's/"//g' document1.txt > document2.txt outputs to the screen correctly but tells me it cant find document2. ok I found that perl -i.bak -pe 's/"//g' document1.txt works but that really doesnt teach me why it didnt work before. |
You need to escape the double quotes, so for your sed statement you would have had to do this:
sed 's/\"//g' document1.txt > document2.txt instead of sed 's/"//g' document1.txt > document2.txt |
Code:
ada@barnabas:~/tmp> cat document1.txt |
All times are GMT -5. The time now is 04:12 AM. |