Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Newbie: extracting only certain cells in a column (xlrd)
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
johannes rara  
View profile  
 More options Oct 29, 12:38 am
From: johannes rara <johannesr...@gmail.com>
Date: Wed, 28 Oct 2009 15:38:35 +0200
Local: Thurs, Oct 29 2009 12:38 am
Subject: Newbie: extracting only certain cells in a column (xlrd)
Hi,

I would like to print out only certain cells in an Excel table. The
extraction criteria is in a third column and if this criteria is met,
I would like to print the information in ninth column.

#-------python code ---------
for i in range(len(sh.col_values(8))):
    if sh.col_values(2).value[i] == "temp":
        print sh.col_values(8)[i]
#---------------------------------

How should I modify my example to get it work.

Many thanks!

- Johannes


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
johannes rara  
View profile  
 More options Oct 29, 1:06 am
From: johannes rara <johannesr...@gmail.com>
Date: Wed, 28 Oct 2009 16:06:33 +0200
Local: Thurs, Oct 29 2009 1:06 am
Subject: Re: Newbie: extracting only certain cells in a column (xlrd)
I found it by myself

for i in range(len(sh.col_values(8))):
    if sh.cell(i, 1).value == "temp":
        print sh.cell(i, 8).value

-Johannes

2009/10/28 johannes rara <johannesr...@gmail.com>:


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Георги Георгиев  
View profile  
 More options Oct 29, 1:08 am
From: Георги Георгиев <georgi_georg...@directservices.bg>
Date: Wed, 28 Oct 2009 16:08:36 +0200
Local: Thurs, Oct 29 2009 1:08 am
Subject: Re: [pyxl] Newbie: extracting only certain cells in a column (xlrd)
i use something like

for i in range(sh.nrows):
    if sh.cell_value(rowx=i, colx=2) == 'temp':
        print sh.cell_value(rowx=i, colx=8)

good luck :-)

georgi


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google