Var tmpFileIn, tmpFileOut: String; tmpList: TStringList; Const ctOutputPath = 'C:\Test\Out_Csv\'; Begin // Init var psExitCode:= 0; tmpFileIn := psFilePath + psFileName; tmpFileOut := ctOutputPath + psFileName; // ... add your code here tmpList := TStringList.Create; Try Try tmpList.LoadFromFile(tmpFileIn); tmpList.Text := psStringReplace(tmpList.Text, '
', #13#10); // https://docs.microsoft.com/nl-be/windows/win32/intl/code-page-identifiers // Function psSaveTxt2File(Text, Destination: String; Encoding: String; WriteBOM: Boolean): Boolean; If psSaveTxt2File(tmpList.Text, ctOutputPath + psFileName, 'ISO-8859-1', False) Then Begin psExitCode := 1; psLogWrite(1, '', 'SaveToFile ' + tmpFileOut + ' Successful'); End Else psLogWrite(1, '', 'SaveToFile ' + tmpFileOut + ' Error'); Except psLogWrite(1, '', 'LoadFromFile ' + tmpFileIn + ' Exception'); End; Finally tmpList.Free; End; End.