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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:45:18+00:00 2026-06-14T05:45:18+00:00

I need to be able to verify a user inputted email and password against

  • 0

I need to be able to verify a user inputted email and password against a csv file which I have that have to make sure that they are in the file and also that they match each other such as;
ojones@coldmail.net ocrabc. Currently I can split the file and print it to the screen but I cannot find a way to put it into an array which I can then refer to. Is there a better way of solving such a problem without an array?

import java.io.*;

import java.util.Arrays;

public class CSVRead{

public static void main(String[] arg) throws Exception {
    BufferedReader CSVFile =
        new BufferedReader(new FileReader("testa453.csv"));
    String dataRow = CSVFile.readLine();
    while (dataRow != null){
        String[] dataArray = dataRow.split(",");
        for (String item:dataArray) {
            System.out.print(item + "\t");
        }
        System.out.println();
        dataRow = CSVFile.readLine();
    }
    CSVFile.close();
    System.out.println();

}

}

EDIT; Just to clarify I am reasonably new to Java and would like to use and array unless there is a more efficient way of solving the problem;

  • 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-14T05:45:19+00:00Added an answer on June 14, 2026 at 5:45 am

    You can create a Map of e-mail -> password

    import java.io.*;
    
    import java.util.Arrays;
    
    public class CSVRead{
    
    public static void main(String[] arg) throws Exception {
        Map<String, String> emailPasswordMap = new HashMap<String, String> ();
        BufferedReader CSVFile =
            new BufferedReader(new FileReader("testa453.csv"));
        String dataRow = CSVFile.readLine();
        while (dataRow != null){
            String[] dataArray = dataRow.split(",");
            emailPasswordMap.put (dataArray[0], dataArray[1]);
            dataRow = CSVFile.readLine();
        }
        CSVFile.close();
    
        String email = "xxx";
        String password = "yyy";
    
        if (password.equals (emailPasswordMap.get (email)) {
            System.out.println ("Email/password combination is valid");
        }
        else {
            System.out.println ("Email/password combination is invalid");
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to be able to process one word or words and verify that
In a bash script I need to verify that the user inputs actual numbers
I need to be able to create an id for a hyperlink. I have
I need to be able to send a file to another website from server-side
I have a self-signed JAR file. I would like for it to be able
I am working on a project in which I need to be able to
I want to be able to verify (or assert) that text is not present
I need to verify that asp.net and c#.net web forms are different or same.
I'm trying to figure out how to verify that the user purchased my app
I have an server setup that consists of 8 machines on which I run

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.