Excel & XLRD - How to find extract cell based on text value...

707 views
Skip to first unread message

Phillip Walker

unread,
May 21, 2012, 5:19:53 PM5/21/12
to python-excel
Hi,

I have been looking everywhere to figure out how I can (1) find a row
based on the first text value of the row and then (2) confirm that the
first row's cell contains the "text" by comparing to a text variable
and then take the entire row and store it into a list to be used later
in generating a new excel sheet in the format i want.

Any help would be great!!

thanks

John Machin

unread,
May 21, 2012, 5:55:27 PM5/21/12
to python...@googlegroups.com

"find a row based on the first text value of the row" needs explanation, with example(s). What does "based on" mean? What does "first text value of the row" mean? What is the "first row"? Which cell in the "first row"? What is 'the "text"'?

Gerard Blais

unread,
May 21, 2012, 6:07:25 PM5/21/12
to python...@googlegroups.com
1) loop over the rows (sh.nrows)
2) get cell value for the row and column 0
3) compare
... 

--
You received this message because you are subscribed to the Google Groups "python-excel" group.
To view this discussion on the web, visit https://groups.google.com/d/msg/python-excel/-/m5rZo6hJqHgJ.

To post to this group, send an email to python...@googlegroups.com.
To unsubscribe from this group, send email to python-excel...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/python-excel?hl=en-GB.



--

Chris Withers

unread,
May 22, 2012, 2:56:39 AM5/22/12
to python...@googlegroups.com, Gerard Blais
Gerard,

> On Mon, May 21, 2012 at 5:55 PM, John Machin <sjma...@lexicon.net
> "find a row based on the first text value of the row" needs
> explanation, with example(s). What does "based on" mean? What does
> "first text value of the row" mean? What is the "first row"? Which
> cell in the "first row"? What is 'the "text"'?

This:

On 21/05/2012 23:07, Gerard Blais wrote:
> 1) loop over the rows (sh.nrows)
> 2) get cell value for the row and column 0
> 3) compare
> ...

...does not actually answer any of John's questions.

Please try again.

Chris

--
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk

John Yeung

unread,
May 22, 2012, 11:51:01 AM5/22/12
to python...@googlegroups.com, Gerard Blais
On Tue, May 22, 2012 at 2:56 AM, Chris Withers <ch...@simplistix.co.uk> wrote:
>
> On 21/05/2012 23:07, Gerard Blais wrote:
>>
>> 1) loop over the rows (sh.nrows)
>> 2) get cell value for the row and column 0
>> 3) compare
>
> ...does not actually answer any of John [Machin]'s questions.

I don't believe Gerard was actually trying to answer John's questions.
It looks like he was offering an outline for the OP (Phillip Walker).

John Y.
Reply all
Reply to author
Forward
0 new messages