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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:26:36+00:00 2026-05-28T05:26:36+00:00

I have a text file in my computer which i am reading form my

  • 0

I have a text file in my computer which i am reading form my java program , now i want to build some criteria

here is my Notepad File :

   #Students
   #studentId   studentkey  yearLevel   studentName token   
   358314           432731243   12          Adrian      Afg56       
   358297           432730131   12          Armstrong   YUY89       
   358341           432737489   12          Atkins      JK671   

        #Teachers
        #teacherId  teacherkey    yearLevel teacherName token   
        358314          432731243   12          Adrian      N7ACD       
        358297          432730131   12          Armstrong   EY2C        
        358341          432737489   12          Atkins      F4NGH

when I read from this note pad file , i get the exact data as it is in my application , but now i want to check if the token which a user just entered on my main page e,g i have the token “JK671” , if this belongs to the token present in the students or Teachers above ?

      output should be like "the token JK671 belongs to Student "..

how could i achieve this ?
thanks

  • 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-28T05:26:37+00:00Added an answer on May 28, 2026 at 5:26 am

    You’ll achieve this by iterating on your teachers and students, and comparing their code with the given token.

    If the codes are unique identifiers, and your program must search by code, then you should creta e a Map<String, Teacher> and an Map<String, Student>, where the keys of the maps are the teacher/student codes, and use the map’s containsKey method to know if such a teacher or student code exists. This will lean to O(1) searches rather than O(n).

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

Sidebar

Related Questions

I have a text file in my computer which I am reading form my
So I am reading from a text file which has product information I have
I have text file with some stuff that i would like to put into
I have text file with some text information and i need to split this
I have a html file which select images from user's computer.code is given bellow
I have a problem here which i am trying to solve. The program is
I have a html file which select images from user's computer.code is given bellow
I am fairly new to php. I have a text file on my computer
Hi just looking for some direction, I have a HTML form which has several
I have a jquery-ui-dialog that contains a <form> which contains a <input type=file >

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.