procedure TForm1.Button1Click(Sender: TObject);
var
f: textfile;
i,j:integer;
str:string;
begin
ASSIGNFILE(f,'LPT1');
try
rewrite(f);
str:='';
for i := 0 to listview1.Columns.Count - 1 do
begin
str := str+listview1.Columns.Caption;
end;
writeln(f,str);
for i := 0 to listview1.Items.Count - 1 do
begin
str := listview1.Items.Caption;
for j := 0 to listview1.Items.SubItems.Count - 1 do
begin
str := str + listview1.Items.SubItems[j];
end;
writeln(f, str);
end;
finally
closefile(f);
end;
end;