cancel
Showing results for 
Search instead for 
Did you mean: 

New line character in File adapter

Former Member
0 Kudos

I am having a receiver file adapter which generates files with multiple lines.

My problem is when the target file is opened in notepad there is no line break and the lines comes as continous string with small rectangle as separator.This fails the target upload program.

When I remove those small squares in notepad and hit enter and then upload it gets uploaded successfully.

Is there any way to have line break so that new line will be generated each time (the documenation says the by-default it adds new line character then why in notepad it opens like a continous string?)

Thanks in advance.

Regards

Rajeev

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Please can you remove the end separater as file adapter by default

<i>The default value is a line break (no explicit separator after the last column; instead the structures are arranged line-by-line).</i>

or you can try putting hexadecimal values.

Regards

Vijaya

Former Member
0 Kudos

Hello

I know by default File Adapter value is line break. But if I open that generated file in notepad, the record does'nt appear on the new line. Instead at the end of each line there is special character added at the end of each record. When I hit enter and deletes that special character and then try to load that file it gets loaded successfully.

So my problem is how to generate the file will give record on the new line. I tried to give 'nl' as endSeparator.

How to give hexadecimal values? I tried giving '0xHH' but that gives error in File Adapter

"Error: Conversion initialization failed: Exception: java.lang.NumberFormatException: For input string: "HH"

"

Thanks in advance.

Regards

Rajeev

moorthy
Active Contributor
0 Kudos

Hi Rajeev,

Is this blog will give some hexadecimal values,.

/people/shabarish.vijayakumar/blog/2005/08/17/nab-the-tab-file-adapter

If you put endSeparator as 'nl' then usually you can see the each records in each line. Check the File Type as Text.. and try..

Thanks,

Moorthy

Former Member
0 Kudos

Hello

Yes I tried with both binary as well as text and had 'nl' as endSeparator but if u see the generated file in notepad (not wordpad. in wordpad it is displayed on separate lines) it gives small square (which is actually a line break character) at the end of each record.

do u know what is the hexadecimal code for line break of enter key?

Thanks and Regards

Rajeev Patkie

Former Member
0 Kudos

hi,

hex for carriage return is 0x0D

hope this helps.

sachin kotalwar

Former Member
0 Kudos

Sachin,

thanks for the reply but we solved the problem in other way. In our upload program we gave line feed character same as that was coming from notepad. Amazingly it worked.

Regards

Rajeev

Former Member
0 Kudos

Hi

i know it was couple of years ago, but i wonder to know if there is any chance that u remember how u finally solved this problem??

i also need to get each line as a separate one in my output file.

trying to use the advice u have got there without success.

i'll be grateful!!!!!!!!!!!!!!

have a wonderful day!!

10x alot,

Yuval

Answers (1)

Answers (1)

bhavesh_kantilal
Active Contributor
0 Kudos

Rajeev,

Try using the option ENDSEPARATOR = 'nl' to create a new line.

http://help.sap.com/saphelp_nw04/helpdata/en/d2/bab440c97f3716e10000000a155106/content.htm

Regards,

Bhavesh