try (BufferedReader br = new BufferedReader(new FileReader("/home/modi/Desktop/hbaseoff/mobiledata.txt")))
{
String sCurrentLine;
while ((sCurrentLine = br.readLine()) != null) {
String[] values = sCurrentLine.split("\t");
System.out.println(values[0]+"-"+values[1]+"\t"+values[2]+"\t"+values[3]+"\t"+values[4]);
}
} catch (IOException e) {
e.printStackTrace();
}
output:
20150320-9876543217 16 45 22
20150320-8876543218 45 11 13
20150320-8876543219 49 15 16
20150321-9876543210 16 45 22
20150321-9876543211 45 11 13
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 1 at Jclass.main(Jclass.java:18)