Ask Your Question
0

Create attributes for each cell in a column [closed]

asked 2013-03-17 18:22:47 +0100

Developforyahu gravatar image

Hi,

I'm creating a program to read LibraOffice spreadsheets. The problem I have is I need to be able to read each Element attributes to be able to extract the information. By default Calc adds the attribute for example: table:table {table:name "sheetname"}.

This is my starting point in my program, but I need to add attributes to each cell. I have only four columns and each column is in category, For example: pots, pans, dishes and cups.

So my, table:table-row's each have four table:table-cell, these cells need the attribute according to their category. so how can I add these in LibraOffice Calc?

Thanks?...

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Alex Kemp
close date 2016-02-19 17:10:22.843378

1 Answer

Sort by » oldest newest most voted
0

answered 2014-03-04 18:46:33 +0100

kumiponi gravatar image

LibreOffice is essentially a WYSIWYG editor and ODF is just a storage format. There is no functionality to directly or indirectly edit the source code of the document, as far as I know. When LibreOffice saves a document, it constructs a file from the document's representation in memory, presumably as efficiently as possible. The file you get may differ significantly from the memory structure.

When you write a program to read a spreadsheet file, you do a similar thing – you reconstruct the table into memory. Presumably the first row you read contains column labels. After that, you can add those labels as attributes to cells in the consecutive rows if you want, or create some other kind of memory structure that suits your needs.

Another way to differentiate and categorize cells would be to create custom styles for them. This way the data table wouldn't have to be ordered by column labels.

edit flag offensive delete link more

Comments

I know this question is a year old, but I thought it still deserved an answer.

kumiponi gravatar imagekumiponi ( 2014-03-04 18:47:51 +0100 )edit

Question Tools

Stats

Asked: 2013-03-17 18:22:47 +0100

Seen: 299 times

Last updated: Mar 04 '14