After I import the data in java using buffered reader from a .dat file I need to split it from the following format
2625::2120::2::973635271
to
4 arrays containing each one of them
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
public class Import {
public static void main(String[] args) throws IOException {
String fileName = "C:/Users/Sharad/Desktop/ml-1m/ratings.dat";
readUsingBufferedReader(fileName);
}
private static void readUsingBufferedReader(String fileName) throws IOException {
File file = new File(fileName);
FileReader fr = new FileReader(file);
BufferedReader br = new BufferedReader(fr);
String line;
while((line = br.readLine()) != null){
//process the line
System.out.println(line);
}
//close resources
br.close();
fr.close();
}
}
this is the code I am using to get this output from a .dat file
2625::2120::2::973635271
now I want to split each number to a different array.