Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.*;
- public class Auslesen
- {
- public static void main (String args[]) throws IOException{
- String Pfad;
- Console cons = System.console();
- System.out.println("Bitte Pfad eingeben");
- Pfad = cons.readLine();
- //String SavePfad = Pfad + "\\Playlist.m3u";
- /* for (int count = 0; count < Pfad.length(); count ++)
- {
- if (Pfad.charAt(count) == '\\' ) {
- Pfad.setCharAt()(count) = 'a';
- }
- }*/
- File file = new File(Pfad);
- File[] files = file.listFiles();
- PrintWriter writer = new PrintWriter(new FileWriter(Pfad + "\\Playlist.m3u"));
- for (int fileInList = 0; fileInList < files.length; fileInList++)
- {
- // writer.write(Integer.toString(fileInList + 1) + " - ");
- writer.write(files[fileInList].getName());
- //writer.flush();
- writer.println();
- }
- writer.close();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement