Advertisement
Guest User

Untitled

a guest
Feb 20th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.24 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.                             if(i<4)
  16.                             {
  17.  
  18.                                 code="@"+sCurrentLine+" ";
  19.                                 i++;
  20.                                 System.out.print(code);
  21.                          
  22.                            
  23.                             }
  24.                             else
  25.                             {
  26.                              code=code+"\n";
  27.                             writer.write(code);
  28.                             code="";
  29.                             i=0;
  30.                             }
  31.             }
  32.  
  33.         } catch (IOException e) {
  34.             e.printStackTrace();
  35.         }
  36.    
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement