I have a CSV file with 16K entries of a data table.
Does Java work well with CSV file? Sorry I am a complete noob
--- Update ---
Okay, so I found this code. And it seems its quite easy to read in the data I need. Say for example if I wanted a loop to randomly pick the first field of a specific line in the CSV data table. How would i go about coding that??????
package cvs.test; import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; public class CVSTest { public static void main(String[] args) throws IOException { String lines = ""; String unparsedFile = ""; String myArray[]; FileReader fr = new FileReader("c://Data1.csv"); BufferedReader br = new BufferedReader(fr); while((lines = br.readLine()) != null) { unparsedFile += lines; } br.close(); myArray = unparsedFile.split(","); for(String item : myArray){ System.out.println(item); } } } }
--- Update ---
Hand Rank Percentile SB BB UG MP CO BN [AJ][AJ] 1 0.01% T T T T T T [AT][AT] 2 0.01% F T T T T T [AQ][AQ] 3 0.02% F F T T T T [AJ][AT] 4 0.02% F F F T T T [A5][A5] 5 0.03% F F F F T T [A9][A9] 6 0.04% F F F F F T [AK][AK] 7 0.04% F F F F F T
The CSV looks like the above. and I basically would like to read in the Hand to get it to show in a text box and then randomly have the program ask me to correctly identify the True/False return for one of the SB/BB/UG/MP/CO/BN columns. As you can prob tel i am not very good with Java... so i am stumbling my way through this. I know what I would like to do it, its just a case of how I get there!!!
Thanks for any replies