Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #101261 > unrolled thread

Re: Need help - How to identify the cell display format?

Started byEzhilarasan Chandrasekar <aezhil90@gmail.com>
First post2016-01-05 12:09 +0530
Last post2016-01-05 12:09 +0530
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Need help - How to identify the cell display format? Ezhilarasan Chandrasekar <aezhil90@gmail.com> - 2016-01-05 12:09 +0530

#101261 — Re: Need help - How to identify the cell display format?

FromEzhilarasan Chandrasekar <aezhil90@gmail.com>
Date2016-01-05 12:09 +0530
SubjectRe: Need help - How to identify the cell display format?
Message-ID<mailman.12.1451975985.2305.python-list@python.org>
I tried the following,

from openpyxl.reader.excel import load_workbook

book = load_workbook(filename='transactions.xlsx')
sheet = book.get_sheet_by_name('transactions')
print sheet.cell("A12").style.number_format
print sheet.cell("A13").style.number_format

But there is some problem with the load_workbook package. I get a error in
reading .xls file.

Could anyone please help me out from this?

Its really Urgent for me, Is there any other alternative way to read excel
cell display format?

--
Warm regards,
Ezhilarasan

On Tue, Dec 15, 2015 at 7:34 PM, Larry Martell <larry.martell@gmail.com>
wrote:

> On Tue, Dec 15, 2015 at 2:29 AM, Ezhilarasan Chandrasekar
> <aezhil90@gmail.com> wrote:
> > Hi folks,
> >
> > I just want to find the cell display format in Excel. I have a Expected
> > excel file and Actual Excel file.
> >
> > I have some knowledge about, how to check the cell value, cell font,
> > alignment. But I also want to know about what type of cell format is
> being
> > used.
> >
> > For example: If the cell value has "*04:05:00 AM*", but it displays as "
> > *04:05:00*"(AM notation not needed) which is of format "*hh:mm:ss*"
> >
> > I want to identify the cell format *(hh:mm:ss)* from Expected Excel file
> > and compare with the Actual Excel file
>
> You can do this with openpyxl, for example:
>
> from openpyxl.reader.excel import load_workbook
>
> book = load_workbook(filename='transactions.xlsx')
> sheet = book.get_sheet_by_name('transactions')
> print sheet.cell("A12").style.number_format
> print sheet.cell("A13").style.number_format
> --
> https://mail.python.org/mailman/listinfo/python-list
>

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web