I am trying to read a csv with two delimiters, which has the following format:
Payment Date,Amount,Member No/branchno
2018/01/25,58,294416/0
the first part is the date and the last column is the column I am facing issues with. I need to split that last column into two columns after the slash.
my problem is that i do not know how to separate the last column without affecting the first column, any Help is really appreciated.
I can already read through the csv and split the commas. here is the code for reading through the csv:
public ArrayList<String[]> ReadCSVFile(File DataFile)
{
try(BufferedReader reader = new BufferedReader (new FileReader(DataFile));){
//while loop to read through the data, while bufferedreader is not null-do ....
while(reader.readLine()!= null)
{
String read = reader.readLine();//bufferedreader string variable
String[] OneRow = read.split(","||"/");
rs2.add(OneRow);
System.out.println(Arrays.toString(OneRow));
//
}
//BufferedReader to Read through CSV Contents
reader.close();
}//end try
catch(Exception ex){
String errmsg = ex.getMessage();
//System.out.println("File not Found: "+errmsg);
}//end exception handling