Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8108971
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T01:16:31+00:00 2026-06-06T01:16:31+00:00

I have 2 excel files: IDList.csv and Database.csv. IDList contains a list of 300

  • 0

I have 2 excel files: IDList.csv and Database.csv. IDList contains a list of 300 ID numbers that I want to filter out of the Database, which contains 2000 entries (leaving 1700 entries in the Database).

I tried writing a for loop (For each ID in the IDList, filter out that ID in Database.csv) but am having some troubles with the filter function. I am using Pyvot (http://packages.python.org/Pyvot/tutorial.html). I get a syntax error…Python/Pyvot doesn’t like my syntax for xl.filter, but I can’t figure out how to correct the syntax. This is what the documentation says:

xl.tools.filter(func, range)
Filters rows or columns by applying func to the given range. func is called for each value in the range. If it returns False, the corresponding row / column is hidden. Otherwise, the row / column is made visible.

range must be a row or column vector. If it is a row vector, columns are hidden, and vice versa.

Note that, to unhide rows / columns, range must include hidden cells. For example, to unhide a range:
xl.filter(lambda v: True, some_vector.including_hidden)

And here’s my code:

import xl 

IDList = xl.Workbook("IDList.xls").get("A1:A200").get() 

for i in range(1,301):
     xl.filter(!=IDList[i-1],"A1:A2000")

How can I filter a column in Database.csv using criteria in IDList.csv? I am open to solutions in Python or an Excel VBA macro, although I prefer Python.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T01:16:32+00:00Added an answer on June 6, 2026 at 1:16 am
    import csv
    
    with open("IDList.csv","rb") as inf:
        incsv = csv.reader(inf)
        not_wanted = set(row[0] for row in incsv)
    
    with open("Database.csv","rb") as inf, open("FilteredDatabase.csv","wb") as outf:
        incsv = csv.reader(inf)
        outcsv = csv.writer(outf)
        outcsv.writerows(row for row in incsv if row[0] not in not_wanted)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have data in Excel files that I am pulling out using the MS
I have multiple excel files which I open as datatable I want to merge
I have multiple .xls files that I want to convert to csv files and
I have two Excel files contains the following structure, EmployeeAllDtl.xlsx id email name age
we have several tens of macro enabled excel files, each of those contains few
I have a series of big excel files that work like a program, but
I have two excel files. First excel file contains the Person Name and Total
I have a Excel CSV files with employee records in them. Something like this:
I have a large number of Excel files. These files I want to add
I have a set of complex Excel files (with figures in it) that I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.