28. Oktober 2019 12:02
UploadIntoStream('Please chose a .txt import file', ImportFolder, 'txt files (*.txt)|*.txt', ImportFile, FileInstream);
CSVBuffer.DeleteAll();
CSVBuffer.LoadDataFromStream(FileInstream, ';');
IF CSVBuffer.FindSet() then
repeat
if (CSVBuffer."Field No." = 2) then
ORVProtelCustomerImport.Init();
case CSVBuffer."Field No." of
2:
begin
ORVProtelCustomerImport."Customer No." := FORMAT(DeleteBadChars(CSVBuffer.Value), 20);
IF Cust.Get(ORVProtelCustomerImport."Customer No.") then
ORVProtelCustomerImport."Customer exists" := true
else
ORVProtelCustomerImport."Customer exists" := false;
end;
4:
ORVProtelCustomerImport.Name := Format(DeleteBadChars(CSVBuffer.Value), 100);
5:
ORVProtelCustomerImport."Name 2" := Format(DeleteBadChars(CSVBuffer.Value), 50);
...
local procedure DeleteBadChars(TextP: Text) CleanText: Text
begin
CleanText := DelChr(TextP, '=', '"');
CleanText := Ansi2Ascii(CleanText);
EXIT(CleanText);
end;
procedure Ansi2Ascii(_String: Text[250]) _Output: Text[250];
begin
// Converts from ANSI to ASCII
EXIT(CONVERTSTR(_String, 'óÚÔõÓÕþÛÙÞ´¯ý’µã¶÷ž¹¨ Íœ°úÏÎâßݾ·±Ð¬‡Š«Œ‹“”‘–—¤•ËÈÊš›™',
'ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø׃áíóúñѪº¿®ÁÂÀÊËÈÍÎÏÌÓßÔÒÚÛÙ'));
end;
28. Oktober 2019 14:19
28. Oktober 2019 17:03
tempblob: Codeunit "Temp Blob";
begin
tempblob.CreateInStream(FileInstream, TextEncoding::Windows);
UploadIntoStream('Please chose a .txt import file', ImportFolder, 'txt files (*.txt)|*.txt', ImportFile, FileInstream);
CSVBuffer.DeleteAll();
CSVBuffer.LockTable();
CSVBuffer.LoadDataFromStream(FileInstream, ';');
IF CSVBuffer.FindSet() then
tempblob: Record TempBlob temporary;
begin
tempblob.blob.CreateInStream(FileInstream, TextEncoding::Windows);
UploadIntoStream('Please chose a .txt import file', ImportFolder, 'txt files (*.txt)|*.txt', ImportFile, FileInstream);
CSVBuffer.DeleteAll();
CSVBuffer.LockTable();
CSVBuffer.LoadDataFromStream(FileInstream, ';');
IF CSVBuffer.FindSet() then
28. Oktober 2019 18:38
29. Oktober 2019 10:13
30. Oktober 2019 14:10
30. Oktober 2019 14:48
Jbb93 hat geschrieben:Es kann doch nicht sein, das ich in einem englischen Server keine deutschen Sonderzeichen mehr einlesen kann??
30. Oktober 2019 15:13
Hi @podgaard ! I think the documentation is outdated. The part about If you set the text encoding to Windows, you can import and export text files that are based on the Windows codepage on the user’s computer. only applies if the user is running the Windows client. If the user is using the web-client and you set the text encoding to Windows, the server's default encoding is used, which is English.
30. Oktober 2019 15:47
Jbb93 hat geschrieben:Er redet da von "English Encoding":
30. Oktober 2019 21:21
21. November 2019 11:00
21. November 2019 11:18
Kennt ansonsten jemand ne Lösung wie man ANSI Dateien automatisiert nach UTF-8 konvertieren kann?
25. November 2019 10:38
25. November 2019 12:08
25. November 2019 12:21
25. November 2019 12:37
fiddi hat geschrieben: Da die ANSI- Kodierung durch den lokalen Client bestimmt wird.
25. November 2019 12:54
25. November 2019 13:02