Skip to content

Instantly share code, notes, and snippets.

@shangeethsivan
Created January 27, 2017 12:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shangeethsivan/90a7ca562002040147aec457f267ea0f to your computer and use it in GitHub Desktop.
Save shangeethsivan/90a7ca562002040147aec457f267ea0f to your computer and use it in GitHub Desktop.
Reading Data From a Fle
Scanner sn=null;
try{
sn=new Scanner(new File("c://file.txt"));
}
catch(Exception e){
}
while(sn.hasNextLine()){
String line=sn.nextLine();
String datas[]=line.split(";");// If data in split
System.out.println("Name"+data[0]+"Number"+data[1]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment