【发布时间】:2014-08-19 12:28:18
【问题描述】:
我正在处理一个文本文件 Waiterstips. 文本文件如下所示:
34.12;45.54;67.99;23.01;99.50;15.14;96.12;
65;67;89;45;00.00;15.23;12.15;00.00;95.32;
87;87;65;97;41.25;36.58;96.14;78.88;11.01;
67;54;57;37;00.00;00.00;10.20;05.00;12.41;
When I use the code below the text file look like this:
10.00;45.54;67.99;23.01;99.50;15.14;96.12
65.00;67.00;89.00;12.50;10.00;15.23;12.15
87.00;87.00;65.00;97.00;41.25;36.58;96.14
67.00;54.00;57.00;50.12;10.00;10.00;10.20
;;;;;;
请帮助我想保存数据,就像我读入时一样。我不想要;;;;最后。
procedure TForm1.BitBtn2Click(Sender: TObject);
var
fFile : TextFile;
iCount : Integer;
begin
AssignFile(fFile, 'Waiterstips.txt');
Rewrite(fFile);
For iCount := 1 to StringGrid1.RowCount - 1 do
begin
Writeln(fFile, StringGrid1.Cells[1,iCount]+ ';'+ StringGrid1.Cells[2,iCount]+ ';' +
StringGrid1.Cells[3,iCount]+ ';' +StringGrid1.Cells[4,iCount]+ ';' +StringGrid1.Cells[5,iCount]
+ ';' +StringGrid1.Cells[6,iCount]+ ';'+StringGrid1.Cells[7,iCount]+ ';');
end;
CloseFile(fFile);
end;
【问题讨论】:
标签: delphi delphi-xe6