Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. import java.io.*;
  2. public class Auslesen
  3. {
  4. public static void main (String args[]) throws IOException{
  5.  
  6. String Pfad;
  7.  
  8. Console cons = System.console();
  9. System.out.println("Bitte Pfad eingeben");
  10. Pfad = cons.readLine();
  11.  
  12. //String SavePfad = Pfad + "\\Playlist.m3u";
  13.  
  14.  
  15. /* for (int count = 0; count < Pfad.length(); count ++)
  16. {
  17. if (Pfad.charAt(count) == '\\' ) {
  18. Pfad.setCharAt()(count) = 'a';
  19. }
  20. }*/
  21.  
  22. File file = new File(Pfad);
  23. File[] files = file.listFiles();
  24.  
  25. PrintWriter writer = new PrintWriter(new FileWriter(Pfad + "\\Playlist.m3u"));
  26.  
  27. for (int fileInList = 0; fileInList < files.length; fileInList++)
  28. {
  29. // writer.write(Integer.toString(fileInList + 1) + " - ");
  30. writer.write(files[fileInList].getName());
  31. //writer.flush();
  32. writer.println();
  33. }
  34.  
  35. writer.close();
  36.  
  37. }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement