ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   .csv Commas ? (https://www.excelbanter.com/excel-discussion-misc-queries/447825-csv-commas.html)

Bob[_19_]

.csv Commas ?
 
Hello,

If I save a file in Excel 2007 as a .csv, does Excel now
place a comma after each, and every, Field automatically ?

Any conditions where it might not ?

I did a simple test where I just put an "x" in Row 1, Column 1
Saved as a .csv. (or, told it to)
Opened it up in Notepad.
Notepad shows the "x", but no comma after it.

Why ?

Thanks.

GS[_2_]

.csv Commas ?
 
Bob explained :
Hello,

If I save a file in Excel 2007 as a .csv, does Excel now
place a comma after each, and every, Field automatically ?

Any conditions where it might not ?

I did a simple test where I just put an "x" in Row 1, Column 1
Saved as a .csv. (or, told it to)
Opened it up in Notepad.
Notepad shows the "x", but no comma after it.

Why ?

Thanks.


There is no comma because "x" is the only data. If you put "x" in A1:B1
then the file will have "x,x".

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion



joeu2004[_2_]

.csv Commas ?
 
"Bob" wrote:
I did a simple test where I just put an "x" in Row 1, Column 1
Saved as a .csv. (or, told it to)
Opened it up in Notepad.
Notepad shows the "x", but no comma after it.
Why ?


The comma is a field __separator__, not a field terminator.

There is no comma after the last field (cell value).

Caveat: You will see a comma after the "last" visible field if the truly
last cell in a row contained the null string.

For the same reason, you might see multiple commas separating fields. The
ones in between represent cells that contained the null string.



All times are GMT +1. The time now is 10:14 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com