Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Ezhilarasan Chandrasekar Newsgroups: comp.lang.python Subject: Re: Need help - How to identify the cell display format? Date: Tue, 5 Jan 2016 12:09:37 +0530 Lines: 53 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de Jc5rQVypsYMv+ZvD4sM51AhB1jmocTnX3/df/UhlUwSg== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'value,': 0.03; 'used.': 0.05; 'subject:help': 0.07; 'cc:addr:python-list': 0.09; 'subject:How': 0.09; 'format?': 0.09; 'example:': 0.10; 'folks,': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'wrote:': 0.16; '>': 0.18; 'email addr:gmail.com>': 0.18; '2015': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'file.': 0.22; 'am,': 0.23; 'dec': 0.23; 'skip:l 40': 0.23; 'tried': 0.24; 'import': 0.24; 'skip:b 30': 0.24; 'header:In-Reply-To:1': 0.24; 'error': 0.27; 'compare': 0.27; 'message-id:@mail.gmail.com': 0.27; 'package.': 0.27; 'actual': 0.28; '"': 0.29; 'larry': 0.29; 'notation': 0.29; 'excel': 0.29; 'print': 0.30; 'url:mailman': 0.30; '15,': 0.30; 'skip:s 30': 0.31; 'anyone': 0.32; 'problem': 0.33; 'url:python': 0.33; 'url:listinfo': 0.34; 'tue,': 0.34; 'file': 0.34; 'this?': 0.34; 'skip:& 20': 0.35; 'received:google.com': 0.35; 'could': 0.35; 'displays': 0.35; 'knowledge': 0.35; 'expected': 0.35; 'but': 0.36; 'there': 0.36; 'url:org': 0.36; 'received:209.85': 0.36; 'subject:?': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'really': 0.37; 'being': 0.37; 'skip:& 10': 0.37; 'display': 0.37; 'received:209.85.213': 0.37; 'received:209': 0.38; 'skip:s 40': 0.38; 'skip:o 20': 0.38; 'format': 0.39; 'subject:the': 0.39; 'url:mail': 0.40; 'some': 0.40; 'identify': 0.61; 'subject:Need': 0.61; 'warm': 0.67; 'urgent': 0.67; 'about,': 0.84; 'excel.': 0.84; 'sheet': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=6q9Ad9Qk9fnrbwG2xqbOO/z76vprZPd9ZupUufdOmWc=; b=yIv7HPappOxO5mu7rGeKnKWjfCaPbYeV/6w7rFENf/8Xkc7e93Gk1YbZc5L7oZsMAT xtobBeoaUBeboopefauKC/CWxTkcly9DwwqARDVgoFRH8SBbfItrFXA8viJLuSSDTvbO jv4io3eN45WXhwY3oBlDvH72H4q8W7+GG6IrjFuuIwWYPkVi+WfcWpQqq21SFafGrQXi 94g3fYeuQpIAtOj6vYD7thflRObl1mLGjXpN3t7Ic1OHOvhS5M89SgosZr3GOwplafmt wIg9DBydCdSjrWW4ikX+49MQ6H5DZrWd/n/oU4qnTiVovKKAPmQZaCaYKP9mdx8mosTS jC4g== X-Received: by 10.31.169.67 with SMTP id s64mr37900068vke.72.1451975977649; Mon, 04 Jan 2016 22:39:37 -0800 (PST) In-Reply-To: X-Content-Filtered-By: Mailman/MimeDel 2.1.20+ X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:101261 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 wrote: > On Tue, Dec 15, 2015 at 2:29 AM, Ezhilarasan Chandrasekar > 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 >