public static void main(String[] args) throws IOException {
String dataRow;
BufferedReader CSVFile =
new BufferedReader(new FileReader("test.csv"));
while ((dataRow = CSVFile.readLine()) != null) {
System.out.println(dataRow.split(";")[0]);
}
// Close the file once all data has been read.
CSVFile.close();
// End the printout with a blank line.
System.out.println("Done");
}
The CSV file I am Trying to read in normal text view
ID;Numbers
12;234
343;233
All I am able to print is space no strings in it.
Output
1. ��I
2.
3.
4.
Done
The File Encoding is Only "UNICODE"
How to read a Unicode file in java. Do I have to set a parameter setting the encoding type of the file in FileReader java class construtor??
Kindly advise.