excel - Modifying and creating xlsx files with Python, specifically formatting single words of a e.g. sentence in a cell -
i'm working lot excel xlsx files convert using python 3 pandas dataframes, wrangle data using pandas , write modified data xlsx files again.
the files contain text data may formatted. while modifications (which have done) have been pretty straight forward, experience problems when comes partly formatted text within single cell:
example of cell content: "medical device whith remote control , bluetooth module communication"
the formatting in example bold , italic may color.
so, have 2 questions:
- is there way of preserving such formatting in xlsx files when importing file python environment?
- is there way of creating/modifying such formatting using specific python library?
so far have been using pandas, openpyxl, , xlsxwriter have not succeeded yet. shall appreciate help!
as pointed out below in comment , linked question openpyxl not allow kind of formatting:
any other ideas on how tackle task?
i have been working openpyxl. if 1 cell has same style(font/color), can style cell.font
: cell.font.b
means bold andcell.font.i
means italic, cell.font.color
contains color object.
but if style different within 1 cell, cannot help. minor indication on cell.value
Comments
Post a Comment