Advertisement
Guest User

Untitled

a guest
Feb 20th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.25 KB | None | 0 0
  1.  public static void main(String[] args) {
  2.       String sCurrentLine;
  3.       int i=1;
  4.         BufferedReader br = null;
  5.        Writer writer = null;
  6.         try {
  7.                    
  8.                         String myDocumentPath = System.getProperty("user.home") + "\\Documents"+ "\\iMacros" + "\\Macros";
  9.                         String code="";
  10.           writer = new BufferedWriter(new OutputStreamWriter(
  11.           new FileOutputStream(myDocumentPath+File.separator+"usernames1.txt"), "utf-8"));
  12.             br = new BufferedReader(new FileReader(myDocumentPath+"\\list.txt"));
  13.  
  14.             while ((sCurrentLine = br.readLine()) != null) {
  15.                            
  16.                             if(i % 4 == 0)
  17.                             {
  18.                                 writer.write(code+"\n");
  19.                                 System.out.print(code);
  20.                                 code="";
  21.                                 i++;
  22.                             }
  23.                             else
  24.                             {
  25.                                 code=code+"@"+sCurrentLine+" ";
  26.                                 i++;
  27.                            
  28.  
  29.                             }
  30.             }
  31.  
  32.         } catch (IOException e) {
  33.             e.printStackTrace();
  34.         }
  35.    
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement