How to read and select only a specific lines from a CSV file. Pls help
I have a java application to read a CSV file. I've already managed to read them all and output it to System.out.println(). Now the problem is I want to select a specific row of the records. How do I do it? Below is the codes i've typed.
FileReader fr = new FileReader(fileName);
BufferedReader inFile = new BufferedReader(fr);
StringBuffer buf = new StringBuffer();
String line = null;
while ((line = inFile.readLine()) != null) {
buf.append(line);
buf.append("\n");
}
String inString = buf.toString();
System.out.println(inString);
This is the record that i want to read. For example, I want to select n print out line "80,2.90,3.00,3.10,3.20,......."
[Factor1]
Time [s],0.00,0.10,0.20,0.30,0.40,0.50,0.60,0.70,0.80,0.90,1.00,1.10,1.20,1.30,1.40,1.50,1.60,1.70,1.80,1.90,2.00,2.10,2.20,2.30,2.40,2.50,2.60,2.70,2.80,2.90,3.00,3.10,3.20,3.30,3.40,3.50,3.60,3.70,3.80,3.90,4.00,4.10,4.20,4.30,4.40,4.50,4.60,4.70,4.80,4.90,5.00,5.10,5.20,5.30,5.40,5.50,5.60,5.70,5.80,5.90,6.00,6.10,6.20,6.30,6.40,6.50,6.60,6.70,6.80,6.90,7.00,7.10,7.20,7.30
Phi-0 [dB],-0.86,-0.80,-0.80,-0.99,-0.56,-0.53,-0.95

