Quotes in a csv file

  • Follow


I have an Excel file that i run a marco against and it will save it as a csv 
type file (with a different extension). The problem is that some of my cells 
have commas in them. When i open the saved file in Notepad, Excel has put 
double quotes around any cell values that have commas in them. Other than the 
quotes the notepad file looks perfect. Is there a way to get those out of 
there? Her is the part of my code that saves the file if that helps any.

        ActiveWorkbook.SaveAs Filename:= _
        "C:\Documents and Settings\dlefler\Desktop\" & PoId & ".otto", 
FileFormat:=xlTextMSDOS, _
        CreateBackup:=False
0
Reply Utf 11/25/2009 8:21:01 PM

You have a problem.  A CSV file either cannot have commas in the data or
you need to add character to indicate what are real commas and which are
the commas you need to seperate the columns.  the two normal choices are
to put twosets of commas in the CSV file when you have commas in the
cell (not the ones seperating the columns" or to put double quortes
around the data like excel has done with your file.


-- 
joel
------------------------------------------------------------------------
joel's Profile: http://www.thecodecage.com/forumz/member.php?userid=229
View this thread: http://www.thecodecage.com/forumz/showthread.php?t=157300

[url="http://www.thecodecage.com"]Microsoft Office Help[/url]

0
Reply joel 11/25/2009 8:50:35 PM


On Wed, 25 Nov 2009 20:50:35 +0000, joel <joel.4285n4@thecodecage.com>
wrote:

>
>You have a problem.  A CSV file either cannot have commas in the data or
>you need to add character to indicate what are real commas and which are
>the commas you need to seperate the columns.  the two normal choices are
>to put twosets of commas in the CSV file when you have commas in the
>cell (not the ones seperating the columns" or to put double quortes
>around the data like excel has done with your file.

Joel and Dave thank you for your posts. I had the same exact problem a
few weeks ago and my web searching turned up no insight about what was
causing my data to be quoted. Now I understand, thank you!

DUH, csv = COMMA separated values


John Keith
kd0gd@juno.com
0
Reply John 11/27/2009 12:30:03 AM

I have often written macros for people that saves data without quotes or
read data with quotes where excel VBA idd handle the data properly.  I
open the CSV file as a text file and then read/write the data one line
at a time.  but this case it is impossible since there are commas in the
data.


-- 
joel
------------------------------------------------------------------------
joel's Profile: http://www.thecodecage.com/forumz/member.php?userid=229
View this thread: http://www.thecodecage.com/forumz/showthread.php?t=157300

[url=&quot;http://www.thecodecage.com&quot;]Microsoft Office Help[/url]

0
Reply joel 11/27/2009 4:07:50 AM

3 Replies
282 Views

(page loaded in 0.073 seconds)


Reply: