Super User is a question and answer site for computer enthusiasts and power users. 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 have a CSV file that contains a text field that can have commas in it. When importing it into Excel, it's picking up these commas as field separators. I have the field in quotes, and I've tried double quotes as well. Is there any way I can import this as is or should I convert it to another delimiter?

share|improve this question

migrated from Jul 11 '11 at 11:34

This question came from our site for professional and enthusiast programmers.

Please show us the problematic fields, else the answers will be random stabs in the dark. – Jean-François Corbett Jul 11 '11 at 11:52

Make sure there a no spaces between your separated values and wrap each field in quotes:

"1, 2","3, 4"

Will import into 2 cells - the first having "1, 2" and the second having "3, 4"

share|improve this answer
This did the trick for me. I had spaces after the delimiting commas and before the next quoted value. After I removed the spaces, Excel parse my CSV file correctly. – dthrasher Nov 7 '12 at 3:43
what about when there are quotes AND commas as part of the values between separating characters? I'm having tons of issues and there's no spaces after the separating characters and quotes inside a value are escaped with a second quote. – anon58192932 Apr 8 '15 at 16:49

How are you importing it? Are you using the data import function on the ribbon or is this via VBA? Because when I import using the ribbon function I can specify the text qualifier as a " and it would import "abc,123","abc,123","abc,123" as abc,123<next cell>abc,123<next cell>abc,123.

If that isn't working though and you don't have to do this for dozens of files you could do a find-and-replace of "," (including quotes) and replace with "^t"(including quotes) (^t being the MS word version of tab if you do the find and replace in word). Then you can have a tab delimited file...

share|improve this answer

You must log in to answer this question.