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 6565531
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:06:20+00:00 2026-05-25T14:06:20+00:00

I am writing a program that takes in a CSV file and makes a

  • 0

I am writing a program that takes in a CSV file and makes a table out of the content from it. Then I apply a filter that will eliminate the bad entries in it, and I want to store those into a different ArrayList using the .add(originalTable())

The problem I am having is I want to apply different filters and get different ArrayList each with the incremented number. So the OriginalTable is filter0 than filter1 than filter2. The problem I am running into is how do I increment the number of Filter over one ?

       State Population Death
       1     10000      10
       2     10001      10
       3     10002      0
       4     1200       100
       5     1          900
       6     1213       900

Okay so I have data like this in my Table which is just an arrayList of ArrayList, ArrayList one being the rows stored into the columns. Now let say I apply the filter that I want deaths less than or equal to 10 deaths and this should give me another “table” called filter which will give me:

       State Population Death
       1     10000      10
       2     10001      10
       3     10002      0

This will be called filter1 now I apply another filter to this saying let me have only only with population bigger than 10,000 population and this is will result in another “table” called filter2.
Which would look something like this:

       State Population Death
       2     10001      10
       3     10002      0

I don’t know how to increment it from filter0 to filter1 to filter2 and they have to be arrayList of ArrayList each time. Thank you guys so much! 🙂

      else if (task.contentEquals("filter")){
            String filter = keyboard.nextLine(); 
            String[] filterArray = filter.split(" ");
            int colmn = 0;
            String predicate ;
            String Value = "W";
            if(filter.contains("-v ")){
            // do the seperate cutoff strings   System.out.println("yeah it contains v");
            }else{
                colmn = Integer.parseInt(filterArray[1]);
                predicate = filterArray[2];
                //Value = filterArray[3];
                System.out.println(colmn +" "+ predicate + " "+Value);
            }
            for(int i =0; i <table.size(); i++){
                if(table.get(i).get(colmn).toString().contains(Value)){
                    filterTable.add(table.get(i));
                    System.out.println(table.get(i));
                }
            }
  • 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-05-25T14:06:20+00:00Added an answer on May 25, 2026 at 2:06 pm

    You should explore the guava library. The library isn’t huge and provides several ways to solve such problems using oops principles; will help you maintain good object structure.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing a program that takes a single command line argument. This argument needs
I was writing a little program that takes a list and generates a menu
I am writing a program that must communicate with a PHP / web based
I am writing a simple program to insert rows into a table.But when i
I am writing a program where if no command line arguments are supplied i.e
I am writing a program in C++ in what I use some constant data.
I'm fairly new to C but I'm having a bit of trouble writing a
everyone. How would I generate the next color in the color spectrum? Like, a
I have just read isinstance() considered harmful , and it seems reasonable. In short,
Hi This is a pretty specific question, so I hope StackOverflow is meant for

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.