tags:

views:

41

answers:

2

In Excel, let's say I have 5 columns, but not all of the time will a column have data. How can I force it to give a static number of commas?

I end up having some rows like this (as I would like it):

Field1,field2,field3,field4,field5

field1,field2,,,

Then some rows like this:

field1,field2,field3,field4,field5,

field1,field2,

field1,field2,field3,field4,
A: 

you mean when exporting? That should happen by default. I tried it just now with Excel 2007 and all exported lines in the .csv-file had the same amount of commas. Those lines with fewer columns had extra commas at the end, just like in your example

Actual exported excel file:

hello;world;;;;
how;are;you;doing;;
hi;;;;;
welcome;to;;;;
the;jungle;;;;
some;line;with;lots;of;columns

The actual amount of commas is determined by the row with the most columns

Isak Savo
There must be something thats causing this particular sheet to act up. I did notice that in a smaller sample I created trying to reproduce it I was unable. Any idea what Would cause it?
jstoneky
A: 

So in this particular instance, there was a lot of copy pasting going on to create the file.

I finally opened a new worksheet, copied the entire document over, and created a CSV using that.

This resolved my problem.

jstoneky