Procedure TForm1. Button1Click (Sender: TObject);
VarI: integer;
S, F: TextFile;
FirstLine, content: AnsiString;
The begin
OpenDialog1. Options:=[ofAllowMultiSelect ofFileMustExist];
OpenDialog1. Filter:='Text files (*.txt) | *. TXT | All files (*. *) | *. *';
OpenDialog1. FilterIndex:=2; {start the dialog showing all files}
If OpenDialog1. Execute then
With OpenDialog1. Files dofor I:=0 to do the Count - 1
The begin
AssignFile (F, Strings [I]);
Reset (F);
While not Eof (F) do
The begin
Readln (F, FirstLine);
Memo1. Lines. Append (FirstLine);
The end;
CloseFile (F);
The end;
If savedialog1. Execute thenMemo1. Lines. SaveToFile (savedialog1. Filename);
The end;
CodePudding user response:
1, the original text file format, need to format all did not say;2, may through the written text file StringList and write text files,