Skip to content

duplicate cells returned from row.cells #344

@daveoloughlin

Description

@daveoloughlin

The following code iterates through rows in the attached docx. Multiple cell instances have the the same text values somehow.
pu.docx

import docx
import os

doc = docx.Document('pu.docx')
for table in doc.tables:
    rowNo = 0
    for row in table.rows:
        cellNo = 0
        for cell in row.cells:
            print 'rowidx = {0} cellidx = {1} text ={2} '.format(rowNo, cellNo, cell.text)
            cellNo += 1
        rowNo += 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions