import java.io.BufferedReader; import java.io.FileReader; import java.util.Scanner; public class Strins { private static BufferedReader br; public static void main(String[] args) throws Exception { String line=null; String input=null; Scanner sc =new Scanner(System.in); try { System.out.println("enter the path"); input=sc.nextLine(); FileReader fr=new FileReader(input); br = new BufferedReader(fr); while(( line=br.readLine()) != null) { char []ch1=line.toCharArray(); for(int i=0;i<ch1.length;i++) { System.out.print(ch1[i]); if(ch1[i]==';'||ch1[i]=='}'||ch1[i]=='{') { System.out.println(); } } } }catch(Exception e){System.out.println(e);} } }
Wow..
ReplyDelete