How to use the xlrd.cellname function in xlrd

To help you get started, we’ve selected a few xlrd examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github alexfeng / InternationalizationScript-iOS / InternationalScriptDemo / importLocalizableDemo / xlrd-1.0.0 / scripts / runxlrd.py View on Github external
def print_labels(sh, labs, title):
        if not labs:return
        for rlo, rhi, clo, chi in labs:
            print("%s label range %s:%s contains:"
                % (title, xlrd.cellname(rlo, clo), xlrd.cellname(rhi-1, chi-1)))
            for rx in xrange(rlo, rhi):
                for cx in xrange(clo, chi):
                    print("    %s: %r" % (xlrd.cellname(rx, cx), sh.cell_value(rx, cx)))
github extrabacon / pyspreadsheet / python / excel_reader.py View on Github external
def dump_sheet(sheet, sheet_index, max_rows):
  dump_record("s", {
    "index": sheet_index,
    "name": sheet.name,
    "rows": sheet.nrows,
    "columns": sheet.ncols,
    "visibility": sheet.visibility
  })
  for rowx in range(max_rows or sheet.nrows):
    for colx in range(sheet.ncols):
      cell = sheet.cell(rowx, colx)
      dump_record("c", [rowx, colx, cellname(rowx, colx), parse_cell_value(sheet, cell)])
github alexfeng / InternationalizationScript-iOS / InternationalScriptDemo / importLocalizableDemoV2.0 / xlrd-1.0.0 / scripts / runxlrd.py View on Github external
def print_labels(sh, labs, title):
        if not labs:return
        for rlo, rhi, clo, chi in labs:
            print("%s label range %s:%s contains:"
                % (title, xlrd.cellname(rlo, clo), xlrd.cellname(rhi-1, chi-1)))
            for rx in xrange(rlo, rhi):
                for cx in xrange(clo, chi):
                    print("    %s: %r" % (xlrd.cellname(rx, cx), sh.cell_value(rx, cx)))
github alexfeng / InternationalizationScript-iOS / InternationalScriptDemo / importLocalizableDemoV2.0 / xlrd-1.0.0 / scripts / runxlrd.py View on Github external
def print_labels(sh, labs, title):
        if not labs:return
        for rlo, rhi, clo, chi in labs:
            print("%s label range %s:%s contains:"
                % (title, xlrd.cellname(rlo, clo), xlrd.cellname(rhi-1, chi-1)))
            for rx in xrange(rlo, rhi):
                for cx in xrange(clo, chi):
                    print("    %s: %r" % (xlrd.cellname(rx, cx), sh.cell_value(rx, cx)))
github okfn / dataproxy / dataproxy / xlrd / examples / xlrdnameAPIdemo.py View on Github external
continue
            datemode = book.datemode
            for shx in xrange(ref3d.shtxlo, ref3d.shtxhi):
                sh = book.sheet_by_index(shx)
                print >> f, "   Sheet #%d (%s)" % (shx, sh.name)
                rowlim = min(ref3d.rowxhi, sh.nrows)
                collim = min(ref3d.colxhi, sh.ncols)
                for rowx in xrange(ref3d.rowxlo, rowlim):
                    for colx in xrange(ref3d.colxlo, collim):
                        cty = sh.cell_type(rowx, colx)
                        if cty == xlrd.XL_CELL_EMPTY and show_contents == 1:
                            continue
                        cval = sh.cell_value(rowx, colx)
                        sval = showable_cell_value(cty, cval, datemode)
                        print >> f, "      (%3d,%3d) %-5s: %r" \
                            % (rowx, colx, xlrd.cellname(rowx, colx), sval)
github python-excel / xlrd / xlrd / examples / xlrdnameAPIdemo_py3.py View on Github external
continue
            datemode = book.datemode
            for shx in range(ref3d.shtxlo, ref3d.shtxhi):
                sh = book.sheet_by_index(shx)
                print("   Sheet #%d (%s)" % (shx, sh.name), file=f)
                rowlim = min(ref3d.rowxhi, sh.nrows)
                collim = min(ref3d.colxhi, sh.ncols)
                for rowx in range(ref3d.rowxlo, rowlim):
                    for colx in range(ref3d.colxlo, collim):
                        cty = sh.cell_type(rowx, colx)
                        if cty == xlrd.XL_CELL_EMPTY and show_contents == 1:
                            continue
                        cval = sh.cell_value(rowx, colx)
                        sval = showable_cell_value(cty, cval, datemode)
                        print("      (%3d,%3d) %-5s: %r" \
                            % (rowx, colx, xlrd.cellname(rowx, colx), sval), file=f)
github willu47 / git_diff_xlsx / git_diff_xlsx.py View on Github external
def get_cells(sheet, rowx, colx):
        return sheet.cell_value(rowx, colx)

    # loop over worksheets

    for index in range(0,num_sheets):
        # find non empty cells
        sheet = book.sheet_by_index(index)
        outfile.write("=================================\n")
        outfile.write("Sheet: " + sheet.name + "[ " + str(sheet.nrows) + " , " + str(sheet.ncols) + " ]\n")
        outfile.write("=================================\n")
        for row in range(0,sheet.nrows):
            for col in range(0,sheet.ncols):
                content = get_cells(sheet, row, col)
                if content <> "":
                    outfile.write("    " + unicode(xl.cellname(row,col)) + ": " + unicode(content) + "\n")
        print "\n"