Proszę o pomoc... Już próbowałem zrobić program nawet do tego (
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, JvBaseDlg, JvSelectDirectory;
type
TForm1 = class(TForm)
JvSelectDirectory1: TJvSelectDirectory;
src: TEdit;
Button1: TButton;
Button2: TButton;
lista: TListBox;
txt: TMemo;
Label1: TLabel;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
function FindFiles(const Path, Mask: string; IncludeSubDir: boolean; var lst:TStrings): integer;
var
FindResult: integer;
SearchRec : TSearchRec;
begin
result := 0;
FindResult := FindFirst(Path + Mask, faAnyFile - faDirectory, SearchRec);
while FindResult = 0 do
begin
{ do whatever you'd like to do with the files found }
lst.Add(Path + SearchRec.Name);
result := result + 1;
FindResult := FindNext(SearchRec);
end;
{ free memory }
FindClose(SearchRec);
if not IncludeSubDir then
Exit;
FindResult := FindFirst(Path + '*.*', faDirectory, SearchRec);
while FindResult = 0 do
begin
if (SearchRec.Name <> '.') and (SearchRec.Name <> '..') then
result := result +
FindFiles (Path + SearchRec.Name + '\', Mask, TRUE, lst);
FindResult := FindNext(SearchRec);
end;
{ free memory }
FindClose(SearchRec);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
if JvSelectDirectory1.Execute then src.Text:=JvSelectDirectory1.Directory;
end;
procedure TForm1.Button2Click(Sender: TObject);
var
l:TStrings;
i:cardinal;
begin
l:=TStringList.Create;
FindFiles(src.Text+'\', '*.dfm', False, l);
lista.Items:=l;
for i:=0 to lista.Items.Count-1 do begin
txt.Lines.LoadFromFile(lista.items[i]);
txt.Text:=StringReplace(txt.Text, '#'+IntToStr(ord('ą')), 'ą', [rfReplaceAll]);
txt.Text:=StringReplace(txt.Text, '#'+IntToStr(ord('ę')), 'ę', [rfReplaceAll]);
txt.Text:=StringReplace(txt.Text, '#'+IntToStr(ord('ś')), 'ś', [rfReplaceAll]);
txt.Text:=StringReplace(txt.Text, '#'+IntToStr(ord('ż')), 'ż', [rfReplaceAll]);
txt.Text:=StringReplace(txt.Text, '#'+IntToStr(ord('ź')), 'ź', [rfReplaceAll]);
txt.Text:=StringReplace(txt.Text, '#'+IntToStr(ord('ć')), 'ć', [rfReplaceAll]);
txt.Text:=StringReplace(txt.Text, '#'+IntToStr(ord('ń')), 'ń', [rfReplaceAll]);
txt.Text:=StringReplace(txt.Text, '#'+IntToStr(ord('ł')), 'ł', [rfReplaceAll]);
txt.Text:=StringReplace(txt.Text, '#'+IntToStr(ord('ó')), 'Ó', [rfReplaceAll]);
txt.Text:=StringReplace(txt.Text, '#'+IntToStr(ord('Ą')), 'Ą', [rfReplaceAll]);
txt.Text:=StringReplace(txt.Text, '#'+IntToStr(ord('Ę')), 'Ę', [rfReplaceAll]);
txt.Text:=StringReplace(txt.Text, '#'+IntToStr(ord('Ś')), 'Ś', [rfReplaceAll]);
txt.Text:=StringReplace(txt.Text, '#'+IntToStr(ord('Ż')), 'Ż', [rfReplaceAll]);
txt.Text:=StringReplace(txt.Text, '#'+IntToStr(ord('Ź')), 'Ź', [rfReplaceAll]);
txt.Text:=StringReplace(txt.Text, '#'+IntToStr(ord('Ć')), 'Ć', [rfReplaceAll]);
txt.Text:=StringReplace(txt.Text, '#'+IntToStr(ord('Ń')), 'Ń', [rfReplaceAll]);
txt.Text:=StringReplace(txt.Text, '#'+IntToStr(ord('Ł')), 'Ł', [rfReplaceAll]);
txt.Lines.SaveToFile(lista.items[i]);
end;
Application.Terminate;
end;
end.
)
no ale zaprzestałem bo w sumie musiałbym ten plik parsować, żeby to wszystko dobrze działało, więc.... ;/