We're exporting oraclle table content in a fixed record length *.csv file.
'A' || nvl2(field1,rpad(field1,10,' '),lpad('?',144,' '))
|| nvl2(field2,rpad(field2,10,' '),lpad('?',40,' '))
|| nvl2(code1,rpad(MANDANTENCODE,5,' '),lpad('?',5,' ')) || 'B'
The issue is the following, that some records have in field1 or field2 nonprintable characters for example ‚¿‘ HEX BF
the effect is that this according column does not have the expected size.
example correct record
Asämple sample2 33 B
wrong record where the column field1 is only 9 characters long instead of 10
As¿ple sample2 33 B
seems that rpad fails with non expected characters
Thanks for a solution