Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've got a huge (about half a GiB, impossible to use a usual text editor on) CSV file with fields enclosed in double quotes like "abc","def" but need a file without quotes (I am sure this is not going to break the file consistency - a comma is never used inside the values in it).

How to remove all the quotes (without introducing spaces on their places)?

share|improve this question
up vote 9 down vote accepted

tr can do that:

tr -d \" < infile > outfile

You could also use sed:

sed 's/"//g' < infile > outfile
share|improve this answer
Why did you removed < infile > outfile? IMHO it was more informative. – Ivan Dec 14 '12 at 9:27
@Ivan I thought it was probably implicit on second thought. – Chris Down Dec 14 '12 at 9:29
Only when for experienced command line users. Even though I a have used < before a couple of times (to import SQL scripts into MySQL and SQLite) It would be immediately obvious for me that I should use < in this case. I think it would be better to return the full command line example back for further reference of those who may need it. – Ivan Dec 14 '12 at 9:35
@Ivan and @Chris, I've reverted it back (pending review) to include < infile > outfile, hope that's OK. – donothingsuccessfully Dec 14 '12 at 11:22
Thanks, @donothingsuccessfully. I've totally mistyped the previous comment, that's a pity I can't edit it %-] – Ivan Dec 14 '12 at 13:14

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.