3 Spalten, mit 10, 30 und 20 Zeichen. (ohne großartige Fehlerprüfung)
Delphi-Quellcode:
var
TheFile, TheLine: TStringList;
i: Integer;
begin
TheFile := TStringList.Create;
try
TheFile.LoadFromFile('TheFile.csv');
TheLine := TStringList.Create;
try
for i := 0 to TheFile.Count - 1 do begin
TheLine.Text := StringReplace(TheFile[i], #9, sLineBreak, [rfReplaceAll]);
TheFile[i] := Format('%.10s%.30s%.20s', [TheLine[0], TheLine[1], TheLine[2]]);
end;
finally
TheLine.Free;
end;
TheFile.LoadFromFile('TheFile.dat');
finally
TheFile.Free;
end;