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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T03:29:39+00:00 2026-06-01T03:29:39+00:00

I am reading a line by buffer reader in java. Line is: abc 3.8229

  • 0

I am reading a line by buffer reader in java.
Line is:
abc 3.8229 1.0326 1 1 1.1386 1.006

How can I store each word of this line in a string array?

  • 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-01T03:29:41+00:00Added an answer on June 1, 2026 at 3:29 am
      import java.io.*;
       class Record
      {
      String name;
      String s1;
      String s2;
      String s3;
      String s4;
       String s5;
      String s6;
    
      public Record(String name, String s1, String s2, String s3, String s4, String s5,    String s6){
       this.name = name;
       this.s1 = s1;
       this.s2 = s2;
       this.s3 = s3;
       this.s4 = s4;
       this.s5 = s5;
       this.s6 = s6;
    

    }

     public static void main(String args[]){
      try{
       FileInputStream fstream = new FileInputStream("textfile.txt");
          DataInputStream in = new DataInputStream(fstream);
          BufferedReader br = new BufferedReader(new InputStreamReader(in));
          String strLine;
          while ((strLine = br.readLine()) != null)   {
      String[] tokens = str.split(" ");
      Record record = new    Record(tokens[0],tokens[1],tokens[2],tokens[3],tokens[4],tokens[5],tokens[6]);//process  record , etc
    
     }
     in.close();
      }catch (Exception e){
        System.err.println("Error: " + e.getMessage());
     }
      }
      }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was just reading this line: The first thing the format() method does is
I'm running a while loop reading each line in a file, and then fork
I'm very new to Linq, I can find multi-line data reading examples everywhere (by
My simple requirement: Reading a huge (> a million) line test file (For this
The cplusplus.com example for reading text files shows that a line can be read
Other than reading the GetFileName() file and reading to line GetFileLineNumber() of a stackframe
When reading lines from a text file using python, the end-line character often needs
I'm reading a .csv file that was created in Excel with the first line
I'm reading a file using bufferedreader, so lets say i have line = br.readLine();
Reading this question I found this as (note the quotation marks) code to solve

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.