Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Python (http://www.velocityreviews.com/forums/f43-python.html)
-   -   Need A script to open a excel file and extract the data using autofilter (http://www.velocityreviews.com/forums/t755200-need-a-script-to-open-a-excel-file-and-extract-the-data-using-autofilter.html)

Prakash 10-01-2011 05:25 PM

Need A script to open a excel file and extract the data using autofilter
 
Need A script to open a excel file and extract the data using
autofilter and write it in a new sheet or new file like I have to
select all rows in which all the columns contain pass as status

Prakash 10-01-2011 05:35 PM

Re: Need A script to open a excel file and extract the data using autofilter
 
On Oct 1, 10:25*pm, Prakash <prakash...@gmail.com> wrote:
> Need *A script to open a excel file and extract the data using
> autofilter and write it in a new sheet or new file like I have to
> select all rows in which all the columns contain pass as status


from win32com.client import Dispatch
xlApp = Dispatch("Excel.Application")
xlApp.Workbooks.Open(r'C:\Users\Administrator\Desk top\test.xls')
xlApp.Visible = 1

after opening the text.xls file i need to filter all the rows in which
the status column is passed and copy the whole sheet to another sheet

Adam Przybyla 10-03-2011 08:12 AM

Re: Need A script to open a excel file and extract the data using autofilter
 
Prakash <prakashr85@gmail.com> wrote:
> Need A script to open a excel file and extract the data using
> autofilter and write it in a new sheet or new file like I have to
> select all rows in which all the columns contain pass as status

... try this:
http://www.python-excel.org/
Regards
Adam Przybyla

Chris Withers 10-04-2011 06:42 PM

Re: Need A script to open a excel file and extract the data usingautofilter
 
On 01/10/2011 23:00, David Monaghan wrote:
>> after opening the text.xls file i need to filter all the rows in which
>> the status column is passed and copy the whole sheet to another sheet

>
> I don't do this often enough to have it to mind, so what I normally do is
> record a Macro, convert it to VBS and then convert that to Python.


Ouch! Slow, error prone and Windows only ;-)

Please consider using xlrd and described on http://www.python-excel.org

cheers,

Chris

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

Alan Meyer 10-05-2011 01:09 AM

Re: Need A script to open a excel file and extract the data usingautofilter
 
On 10/4/2011 5:12 PM, David Monaghan wrote:
> On Tue, 04 Oct 2011 19:42:06 +0100, Chris Withers<chris@simplistix.co.uk>
> wrote:
>
>> On 01/10/2011 23:00, David Monaghan wrote:
>>>> after opening the text.xls file i need to filter all the rows in which
>>>> the status column is passed and copy the whole sheet to another sheet
>>>
>>> I don't do this often enough to have it to mind, so what I normally do is
>>> record a Macro, convert it to VBS and then convert that to Python.

>>
>> Ouch! Slow, error prone and Windows only ;-)
>>
>> Please consider using xlrd and described on http://www.python-excel.org

>
> All true! The reason I usually do it like that is I normally only need to do
> very simple things and I usually stop at the VBS stage. And I wasn't aware
> of xlrd - I'll give it a look.
>
> DaveM


I've used xlrd. It's pretty nice.

Alan


All times are GMT. The time now is 11:01 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.