Click here to Skip to main content
15,890,123 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how do i get data from a txt file which contain first name, last name, test1 marks, test 2 marks and calculate the Grade A students overall average like that
Can u please tell me i have no idea how to do it
Posted

you havnt provided enough information for us to be able to fully suggest an approach - for example, is that information on each line, separated by commas for instance ?

I would

1) Write a program to read a text file, line by line, and simply output to the console each line as its read
2) when (1) is working, then, once you've read each line (and assuming the data is separated by commas ie ','), split the line into fields - write each field to the console

3...n depend on what else you need to do to the data

obviously, comments, error handling, closing the file ...

'g'
 
Share this answer
 
v2
To add to solution 1 by Garth, you can find out how to read/write and parse text in Java => Reading and writing text files in Java[^].
More tutorials in Java coding can be found => Learn Java[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900