Home > Back-end >  Ask ace to help me to modify the code: data file consolidation issues
Ask ace to help me to modify the code: data file consolidation issues

Time:09-28

I am a novice, wrote a merged data file code, the question now is: the merged data file format is not what I want, after the merger is segmented according to the data file, all I need is separated by a space data file, rather than segmented display, warrior, please help me! Thank you very much! Here is my original code:
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,