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 l开发者_高级运维ike this:
field1,field2,field3,field4,field5,
field1,field2,
field1,field2,field3,field4,
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
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.
精彩评论