Creating CSV and line feed in a cell
Posted: Wed May 21, 2025 12:12 am
Hi everybody,
I need to read a DB2 file and create a CSV file from it.
This is not a problem so far - but I have to read several lines of text in a loop and then I have to output them in a single CSV cell. However, the text should not be written as a long text, but after each line a line break should be issued, so that Excel can recognize it when the CSV file is displayed.
How do you do this? I either always get a line feed that doesn't stay in the cell, but breaks the whole CSV line and ruins everything - or none at all?
I tried ( a little bit simplified here) - but this onley leads to
#LineFeed := (10).AsUnicodeString /* Hex 0A */
Select Fields(#TEXT) From_File(TEXTBSL0) With_Key(#SMHMANDAN "1") Io_Status(#IO$STS) Io_Error(*NEXT) Val_Error(*NEXT)
#CSV_CELL_TEXT += #LineFeed.AsNativeString + #TEXT'
Endselect
But that only confuses Excel.
Do you know how to do this with RDMLX?
Many thanks in advance,
Joerg
I need to read a DB2 file and create a CSV file from it.
This is not a problem so far - but I have to read several lines of text in a loop and then I have to output them in a single CSV cell. However, the text should not be written as a long text, but after each line a line break should be issued, so that Excel can recognize it when the CSV file is displayed.
How do you do this? I either always get a line feed that doesn't stay in the cell, but breaks the whole CSV line and ruins everything - or none at all?
I tried ( a little bit simplified here) - but this onley leads to
#LineFeed := (10).AsUnicodeString /* Hex 0A */
Select Fields(#TEXT) From_File(TEXTBSL0) With_Key(#SMHMANDAN "1") Io_Status(#IO$STS) Io_Error(*NEXT) Val_Error(*NEXT)
#CSV_CELL_TEXT += #LineFeed.AsNativeString + #TEXT'
Endselect
But that only confuses Excel.
Do you know how to do this with RDMLX?
Many thanks in advance,
Joerg