How to Read Multiple Records From a File Using Java
Max O'Didily
How to Read Multiple Records From a File Using Java
Greetings, I am back with another tutorial and today I am here with how to read multiple records from a csv or any type of file. There may be instances where you wish to read all matches for a search term like: list all teachers who teach Economics or list all items below a certain price. I hope you enjoy and have a spectacular day.
Please note:
data = currentLine.split(","); should be: data = currentLine.split(delimiter);
If you are using a csv file then you shouldn't encounter any issues but if you are using a custom delimiter be sure to change the line to the corrected version, this was an oversight and I am grateful it was pointed out. This change just tells Java to use the delimiter passed into the method instead of a hard-coded comma ",".
Subscribe to keep notified when I upload? https://tinyurl.com/SubMaxODidily
How to Read Multiple Records From a File Using Java ... https://www.youtube.com/watch?v=WxKqlapWzHY
36341039 Bytes