Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Removing Line-Feed characters while reading a dataset

Hi Experts,

I am facing a problem while reading a .txt file which was exported from an excel file and contains some box like characters (which i think are from alt+enter or line-feed). Below is a sample data from one of the rows:

RH LTMHI_FG1 1600 "HORIZONTAL [] FLANGE" 1 4

1 ABCD 1200 "HORIZONTAL [] FLANGE" 1 6

Please read '[]' as a box symbol (or hex "0D0A"')l because it is not possible to paste it here as the editor is taking that as a line-feed.

My problem is that the below code is reading data only up to the box symbol and is not reading the rest of the data.

OPEN DATASET v_file_name FOR INPUT IN TEXT MODE ENCODING DEFAULT.
CLEAR lv_record.
READ DATASET z_data_file INTO lv_record.

I have tried with all the line-feed options and the encoding options but no success. So please suggest me how should i either remove these box symbols or read the entire line. I have no control over how this .txt file is generated.

Thanks in advance.

Best Regards,

Kush Kashyap

Former Member
Not what you were looking for? View more on this topic or Ask a question