i have an input in a file where i have some numbers in the format
106,648|403,481 747,826|369,456 758,122|365,637 503,576|808,710 325,374|402,513
not i want to format the number as 106,648 403,481 747,826 .. and so on but i am unable to do this i have done this so far
public class MidPointSum {
public static void main(String[] args) {
File file=new File("D:/midpoint.txt");
try{
Scanner sc=new Scanner(file);
while(sc.hasNext()){
String value=sc.next();
String getVal[]=value.split("|");
for(int i=0;i<getVal.length;i++){
System.out.println(getVal[i]);
}
}
}catch(FileNotFoundException e){
System.err.println("File is not Found");
}catch (Exception e){
System.err.println("Another Exception");
}
}
but i am not getting the desired output.Please someone help me ..