Import excel file in python and identify cells of which the content is strikethrough
<p>I want to read in many Excel documents and I would like to receive at least one important bit of information on the format. However, I am afraid that there is no tool for it, so my hope is on you!</p>

<p>Each excel file that I am reading in contains a few cells that of which the content is strikethrough. For those who don't know the word (I didn't know it either), strikethrough means that there is a horizontal line through the content.</p>

<p>I have figured out that I will need to read in my documents with xlrd to be able to identify the fonts. However, I have been going over a list of possibilities and none of them contains a check on strikethrough.</p>

<p>You have to open the workbook with <code>formatting_info</code> kwarg as <code>True</code>. Then, get <code>the</code> XF object of the cells and get the <code>Font</code> object. The <code>struck_out</code> attribute is what you're looking for. An example:</p>

<pre><code>workbook = xlrd.open_workbook(filename, formatting_info=True)
sh = workbook.sheet_by_name(sheet)
xf = workbook.xf_list[sh.cell_xf_index(row, col)]
font = workbook.font_list[xf.font_index]
if font.struck_out:
    print(row, col)
</code></pre>

python excel fonts strikethrough