Autor Beitrag
AXMD
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: Fr 03.03.06 12:10 
Morgen!

Kennt irgendjemand ein Programm, mit dem man möglichst schnell nur den Laufwerksbuchstaben aller Files in einer Playlist ändern kann? Da ich meinen MP3-Ordner auf ein anderes Laufwerk verschieben möchte, ist der Laufwerksbuchstabe logischerweise ein anderer, nur habe ich keine List, alle Playlists deshalb neu zu erstellen.

AXMD
Handycommander
ontopic starontopic starofftopic starofftopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 1054

Windows XP Pro, Vista
Visual Studio 2008
BeitragVerfasst: Fr 03.03.06 12:40 
was ist des für eine playlist?
AXMD Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: Fr 03.03.06 12:54 
Foobar hat die generiert. Hat die Endung pls. Mit dem Editor kann man nicht viel ausrichten - sind einige "Nicht-ASCII"-Zeichen dabei, die beim Speichern irgendwie verloren gehen, sodass der Player die Playlist dann nicht mehr akzeptiert.

AXMD
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19314
Erhaltene Danke: 1747

W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Fr 03.03.06 13:51 
Wie wärs mit WordPad? Das unterstützt ja auch Unicode und sowas alles, da sollte das doch gehen.

Du solltest nur die Dateien vorher in .txt umbenennen, damit WordPad nicht auf die Idee kommt, da Formatierungen reinzuhauen.
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Fr 03.03.06 14:51 
Mach doch in den Dateien ein binäres Search&Replace?

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8548
Erhaltene Danke: 477

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Fr 03.03.06 16:52 
pls sind eigentlich vom Aufbau her wie Ini-Dateien (zumindest hoff ich das, so hab ich das nämlich gerade in Nemp eingebaut...).
Das müsste dann in etwa so gehen:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
ini := TMeminifile.Create(filename);
NumberOfEntries := ini.ReadInteger('playlist','NumberOfEntries',-1);
for i := 1 to NumberOfEntries do
begin
  oldFilename := ini.ReadString('playlist','File'+ IntToStr(i),'');
  // Abfrage:
  if (OldFilename[1] = 'C')
      AND (OldFilename[1] = ':')
      AND (OldFilename[1] = '\')
  then
  begin
    OldFilename[1] := 'D';
    ini.WriteString('playlist''File'+IntToStr(i),OldFilename);
  end;
  // else 
  //der Pfad ist relativ gespeichert - daher keine Änderung nötig
end;
ini.UpdateFile;
ini.Free;


Edit: Oh, seh grade, dass das gar keine Delphi-Frage war...aber den Rest des Programms drumrum schreiben dürfte schnell gehen, oder? :tongue:

Ansonsten: schick mir eine der pls mit "komischen Zeichen" bitte mal per Mail, damit bei der nächsten Veröffentlichung meines Players dieser Fehler dann schon ggf. ausgebügelt ist ;-)

_________________
We are, we were and will not be.
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Fr 03.03.06 17:16 
user profile iconGausi hat folgendes geschrieben:
pls sind eigentlich vom Aufbau her wie Ini-Dateien (zumindest hoff ich das, so hab ich das nämlich gerade in Nemp eingebaut...).
Das müsste dann in etwa so gehen:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
ini := TMeminifile.Create(filename);
NumberOfEntries := ini.ReadInteger('playlist','NumberOfEntries',-1);
for i := 1 to NumberOfEntries do
begin
  oldFilename := ini.ReadString('playlist','File'+ IntToStr(i),'');
  // Abfrage:
  if (OldFilename[1] = 'C')
      AND (OldFilename[1] = ':')
      AND (OldFilename[1] = '\')
  then

  begin
    OldFilename[1] := 'D';
    ini.WriteString('playlist''File'+IntToStr(i),OldFilename);
  end;
  // else 
  //der Pfad ist relativ gespeichert - daher keine Änderung nötig
end;
ini.UpdateFile;
ini.Free;


Edit: Oh, seh grade, dass das gar keine Delphi-Frage war...aber den Rest des Programms drumrum schreiben dürfte schnell gehen, oder? :tongue:

Ansonsten: schick mir eine der pls mit "komischen Zeichen" bitte mal per Mail, damit bei der nächsten Veröffentlichung meines Players dieser Fehler dann schon ggf. ausgebügelt ist ;-)


Der Logik muss ich zustimmen *g*

Sollte wohl
ausblenden Delphi-Quelltext
1:
2:
3:
4:
  if (OldFilename[1] = 'C')
      AND (OldFilename[2] = ':')
      AND (OldFilename[3] = '\')
  then


heßen *g*

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
Martin1966
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1068

Win 2000, Win XP
Delphi 7, Delphi 2005
BeitragVerfasst: Fr 03.03.06 17:22 
user profile iconBenBE hat folgendes geschrieben:
Sollte wohl
ausblenden Delphi-Quelltext
1:
2:
3:
4:
  if (OldFilename[1] = 'C')
      AND (OldFilename[2] = ':')
      AND (OldFilename[3] = '\')
  then


heßen *g*

Das wäre sinnvoll ;-)

Vielleicht sollte man auch noch vorher prüfen ob der Dateiname aus mindestens drei Zeichen besteht um einen Fehler zu vermeiden. In diesem Fall wahrscheinlch er unwahrscheinlich aber trotzdem. :-D

Lg Martin

_________________
Ein Nutzer der Ecke ;-)
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8548
Erhaltene Danke: 477

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Fr 03.03.06 17:30 
Ach verdammt...blödes Copy&Paste :motz:

Das Abfangen des Fehlers bei zu kurzen Strings trau ich Andreas aber auch so zu ;-)

_________________
We are, we were and will not be.
Martin1966
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1068

Win 2000, Win XP
Delphi 7, Delphi 2005
BeitragVerfasst: Fr 03.03.06 17:38 
user profile iconGausi hat folgendes geschrieben:
Das Abfangen des Fehlers bei zu kurzen Strings trau ich Andreas aber auch so zu ;-)


Außer er macht es wie du: Copy&Paste :mrgreen:

_________________
Ein Nutzer der Ecke ;-)
blackbirdXXX

ontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 1077
Erhaltene Danke: 1

Ubuntu Dapper

BeitragVerfasst: Sa 04.03.06 18:28 
Da lob ich mir mein sed:
ausblenden Quelltext
1:
sed -e 's/^C:\\/D:\\/' myplaylist.pl > neu.pl					

_________________
Klein, schwarz und ärgert Techniker? Jumper!
tommie-lie
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 4373

Ubuntu 7.10 "Gutsy Gibbon"

BeitragVerfasst: Sa 04.03.06 18:36 
user profile iconblackbirdXXX hat folgendes geschrieben:
Da lob ich mir mein sed:
Für alles andere gibt es Masterc^WCygWin ;-)

_________________
Your computer is designed to become slower and more unreliable over time, so you have to upgrade. But if you'd like some false hope, I can tell you how to defragment your disk. - Dilbert