| View previous topic :: View next topic |
| Author |
Message |
contactme General User

Joined: 26 Oct 2007 Posts: 9
|
Posted: Tue Oct 30, 2007 11:56 am Post subject: generating a csv file without empty cells - how? |
|
|
Hi,
I have a spreadsheet having different number of columns filled in different rows, and I want to generate a csv file, ignoring those empty cells: for example, if there is no data for the field "address2" in the 2nd row, I am getting the following output:
"Name","Address1","Address2","City"
"A","M street","basement","NY"
"B","X street",,"NY"
The desired output is:
"Name","Address1","Address2","City"
"A","M street","basement","NY"
"B","X street","NY"
Any suggestions will be appreciated.
Moderaor have suggested me to put in here, so if anybody can suggest me any macro which can solve this solution that would be great...
(http://www.oooforum.org/forum/viewtopic.phtml?p=259144#259144)
thanks |
|
| Back to top |
|
 |
PBiela Power User


Joined: 10 Feb 2004 Posts: 56 Location: Frankfurt/Main Germany
|
Posted: Wed Oct 31, 2007 3:07 am Post subject: |
|
|
Hi there,
i would suggest, you export it as csv and then manipulate the csv-file directly.
There you just have to replace any occurance of ",," or "[,]+" with ",".
That might be easier than copying the data or your spreadsheet into a new sheet without empty cells and generate the csv correctly.
Hope that helped a bit. _________________
Who is John Galt? - Ayn Rand  |
|
| Back to top |
|
 |
contactme General User

Joined: 26 Oct 2007 Posts: 9
|
Posted: Wed Oct 31, 2007 11:22 am Post subject: |
|
|
yeah, that's always an option but that would mean I would be modifying my parser to handle that scenario as my parser would be parsing the csv files ..
thanks, but can get macro as well that would be great.. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|