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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T17:53:27+00:00 2026-06-06T17:53:27+00:00

Can we separate the List of only names from the data from file system

  • 0

Can we separate the List of only names from the data from file system as

Name    Age Sex Address
dani    21  Male    US
ron     34  Male    NY
stella  23  Female  NY
steave  43  Male    US  
[End]

I have tried to set the Delimiters as’\t’ in above data while inserting into file.
I tried

try 
{
fin = openFileInput("FileSystemDatabase.dat");
isr = new InputStreamReader(fin);
br = new BufferedReader(new InputStreamReader(fin));
while ((line = br.readLine()) != null) 
    {
           if (line.equals("\rName\tAge\tSex\tAddress\n"))
                 break;
    }
Pattern p = Pattern.compile("\r\n\\d\t");
while ((line = br.readLine()) != null) 
    {
           if (line.equals("[End]"))
                   break; 
           Matcher m = p.matcher(line);
           if (m.matches()) 
           {
                   text =m.group(1);
                   tv=new TextView(this);
                   tv.setText(text);

           }
    }
}
catch (Exception e)
{
    e.printStackTrace();
}

But i am not getting the correct result to get correct List.Is there is any simple way to get it?
Please help me..

  • 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-06T17:53:28+00:00Added an answer on June 6, 2026 at 5:53 pm

    Try this.. You will get only the names:

         while ((line = br.readLine()) != null && (line.equals("Name\t\tAge\tSex\tAddress\n"))) {
                Log.e("String ", "" + line);
                break;
            }
    
            while ((line = br.readLine()) != null) {
                if (line.equals("[End]"))
                    break;
                splitString = line.split(" ");
                Log.e("Name ", "" + splitString[0]);
            }
    

    Output:

    06-28 11:30:08.009: E/String(3713): dani 21 Male US

    06-28 11:30:08.009: E/Name(3713): dani

    06-28 11:30:08.009: E/String(3713): ron 34 Male NY

    06-28 11:30:08.009: E/Name(3713): ron

    06-28 11:30:08.009: E/String(3713): stella 23 Female NY

    06-28 11:30:08.009: E/Name(3713): stella

    06-28 11:30:08.009: E/String(3713): steave 43 Male US

    06-28 11:30:08.009: E/Name(3713): steave

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

Sidebar

Related Questions

simple logic here, I don't know how I can separate the value from a
How can I separate the leading letter from the trailing number in each of
How can we separate Logic from presentation without using any template engine (traditional php-not
I am trying to create a pdf viewer but I can't separate view from
Can YouTube videos be played from within an AndroidOS without launching the separate YouTube
Fronting tomcat with httpd solves a big problem for us. We can separate httpd
Can CouchDB handle thousands of separate databases on the same machine? Imagine you have
How can I create a separate crash handler like GoogleCrashHandler ?
I have two xml files which have the same data but different names for
So i am working with some email header data, and for the to:, from:,

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.