SHARE
TWEET

Untitled

a guest Jul 20th, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. package file;
  3.  
  4. import java.io.BufferedReader;
  5. import java.io.FileReader;
  6. import java.io.FileWriter;
  7. import java.io.IOException;
  8. import java.util.HashSet;
  9.  
  10. public class File {
  11.  
  12.     public static void main(String[] args)throws IOException {
  13.         BufferedReader be = new BufferedReader(new FileReader("command.txt"));
  14.         HashSet<String> adat = new HashSet<String>();
  15.         String sor;
  16.         while ((sor=be.readLine())!=null) {
  17.             adat.add(sor);
  18.         }
  19.         be.close();
  20.         FileWriter ki = new FileWriter("output.txt");
  21.             for (String kiline : adat) {
  22.                 ki.write(kiline);
  23.             }
  24.        
  25. }
  26. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top