Skip to Content

UNIX to DOS file conversion - extra LF & CR !

Hello Experts,

My team is facing a file conversion issue so I thought I'd drop by for some expert advice.

It is a File to File scenario.

The sender & Receiver systems were both UNIX based systems initially & we had no issues then.

Now that the receiver system moved on to Windows based OS, the files we receive from the sender seem incompatible!

Looks like we have extra "Line Feeds" & "Carriage Returns".

The file when generated in the UNIX system has a "0D" (hex character) embedded at every line end.

When this file is received by the Windows system, an extra "0A" and a "0D" is added to it making it "0D0D0A" ! & this is causing technical issues while processing the file further.

Is SAP PI 7.1 equipped to solve this issue?

If not, How can the issue be solved ?

Please share your thoughts.

Thanks in advance,

Sam Anish

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Posted on Aug 16, 2013 at 08:35 AM

    Hi Sam ,

    Please try Hexdecimal values for newline and other symbols . when we change the environment from unix to some other . some time we face this issue

    for 'nl' = '0x0a' hexadecimal values .

    Regards,

    Rudra

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 28, 2013 at 06:26 AM

    Try processig as Text and not Binary. DOS text files traditionally have carriage return and line feed pairs as their newline characters while Unix text files have the line feed as their newline characters. When files are procesed as text, this is normally handled automatically when the file is created/generated. But when you process them as binary it's passed through 'as is', and then windows OS adds it's own CR/LF to the already existing LF.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 23, 2015 at 04:25 AM

    Hi Sam,

    Were you able to solve this issue?

    Unfortunately even I am facing the same issue.

    Thanks,

    Swati

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Sam Anish

      Hi Sam,

      My scenario was actually FTP-->SFTP with a little mapping. There is an option to select file type in as binary or text. When I selected text, it had 3 more options :

      CR

      LF

      CR/LF

      On selecting CR/LF the files went just fine in UNIX format.

      PS: The SFTP adapter that we have in our 7.11 system is ADVANCO's.

      Thnx,

      Swati

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.