Advertisement
Guest User

Untitled

a guest
Jun 2nd, 2015
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. import java.io.*;
  2. import java.util.*;
  3.  
  4. public class only_emails{
  5. public static void main(String[] args)throws IOException {
  6. BufferedReader br = new BufferedReader(new FileReader("input_mails.txt"));
  7. PrintWriter pw = new PrintWriter("mails.txt");
  8.  
  9. String str = "<";
  10. String end = ">";
  11. int stri = 0;
  12. int endi = 0;
  13. int counter = 1;
  14.  
  15. String mail = "";
  16. String mod = "";
  17. while((mail = br.readLine()) != null){
  18. System.out.println(mail);
  19. stri = mail.indexOf(str);
  20. endi = mail.indexOf(end);
  21.  
  22. System.out.println((stri)+" "+endi);
  23.  
  24. mod = mail.substring(stri+1,endi);
  25. System.out.println(mod);
  26.  
  27. pw.println("\""+mod+"\""+",");
  28. System.out.println(counter+" Done");
  29. counter++;
  30. }
  31. pw.close();
  32. }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement