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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T18:15:31+00:00 2026-05-13T18:15:31+00:00

Is there a way to read two lines of a csv file at a

  • 0

Is there a way to read two lines of a csv file at a time in Java?

I can read one at a time using Scanner (it has to be done like this):

String line = input.nextLine();
String[] nline = line.split ("[,]");
......

Here is some sample data and a short explanation. I need these read two at a time so I can can go about my other processing.

the first line that starts with “Create” creates a person
the second line “action” is the action of the created person

create,Mr. Jones,blah,blah 
action,1,3
create,Mrs.Smith,blah,blah
action,4,10
....

Thanks in advance.

  • 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-13T18:15:32+00:00Added an answer on May 13, 2026 at 6:15 pm

    Cory’s answer is good but for your next part to work

    String[] nline = line.split ("[,]");
    ......
    

    You need to add the comma in there

    String line = input.nextLine() + "," + input.nextLine();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a better way to read lines two at a time from a
Is there any way to read a file using sharpsvn................
Is there any way to read a TIFF file using AIR ? Looks like
In C#/.NET (on Windows) is there a way to read a growing file using
Is there any way to read whole lines from a socket in Erlang, or
Is there a way to read off from an [external] xml (an xml file
Is there any way to read a file line by line in javascript, specifically
Is there a pythonic way (I know I can loop using range(len(..)) and get
Is there a way to read a ByteBuffer with a BufferedReader without having to
Is there any way to read the asp.net Import directives at runtime? I have

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.