excel .csv format


Posted by dan liu on September 07, 2001 10:40 AM

Hi, All

I save my excel file as .csv format.
The file is as simple as following: (total 25 rows)
*******************************
column1 column2 column3 column4
1 2
1 2
*******************************

I open the .csv using notepad.
The file looks like:
*******************************
a,b,c,d
1,2,,
1,2,,
1,2,,
1,2,,
1,2,,
1,2,,
1,2,,
1,2,,
1,2,,
1,2,,
1,2,,
1,2,,
1,2,,
1,2,,
1,2,,
1,2
1,2
1,2
1,2
1,2
1,2
1,2
1,2
1,2
*************************
As you can see, comma is missing after line 17.
Is there any way to keep these comma there?

Thanks for you help.



Posted by Ben O. on September 07, 2001 12:30 PM

Dan,

I did some experimenting with .CSVs and I think I realize what the problem is. After a certian point, Excel considers the cells in columns 3 and 4 "inactive" and therefore stops creating commas to mark off their values. The only reason it puts commas there in the first couple dozen rows is because you have column labels.

To fix the problem, enter a formula that will always result in a null value, such as ="" or =IF(2+2=5,1,""), in all the cells in columns 3 and 4. That way Excel will consider the cells active and keep the commas there in your CSV.

-Ben