0

I have a text file named studentInfo.txt. The file contains these texts

376,Pronay sarker,CSE,hdofhdoif,64,3.19(Introduction to programming language one, Math calculus)
377,Plabon sarker,DS,iugfdofy98,64,3.2,(null)
388,Sourav Mojumdar,CSE,odfjdof33,64,3.29,(null)
379,Nobita,SWE,h3efe,65,4.5,(null)

These values are studentID, studentName, department, password, batch, cgpa and their courses. Please note that they're separated by , (comma).

I created a string String name;.But how do I assign the name of the student with student ID 379 (here it is Nobita) into that string variable name?

I couldn't think of using FileReader since it reads files by a single character. would you mind helping?

2
  • Note that this file is in a CSV format. Try searching on how to read that from CSV files. Commented Dec 21, 2023 at 20:51
  • But how do I assign the name of the student with student ID 379 - By creating a Student class and applying the file data to instances of Student, here is an example of how this could be done. Commented Dec 22, 2023 at 20:05

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.