On Fri, Jun 26, 2015 at 10:39 AM, Gleb Stepanov <
gleb.s...@gmail.com> wrote:
> As example, i've got cell like this: Something bold in the cell.
> I want to read the cell and send the string further through json to web-form
> with the format like this: {"test-string":"Something <b>bold</b> in the
> cell."}
Your requirements are almost exactly the same as what is in this Stack
Overflow question:
http://stackoverflow.com/questions/5629084/reading-rich-text-from-an-excel-cell
Maybe the responses there will give you some ideas, if you're willing
to stray from Python or investigate whether Microsoft-centric
solutions can be adapted for tools like pywin32 or xlwings. In any
case, if you want to do further research, you should be adding the
term "rich text" to your search.
I think an easier path, if you have access to the actual Excel program
(not just the workbook file), is to save the file in another format,
such as "XML Spreadsheet". This is much easier to parse (though not
with xlrd or OpenPyXL). It is even already close to what you want. For
example, this is what a cell looks like in that format:
<Cell><ss:Data ss:Type="String"
xmlns="
http://www.w3.org/TR/REC-html40"><Font
html:Color="#000000">Something </Font><B><Font
html:Color="#000000">bold</Font></B><Font
html:Color="#000000"> in the cell.</Font></ss:Data></Cell>
John Y.