Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2007
    Posts
    13

    Unanswered: Unable to insert new line character in a file

    Hi All,

    I am using Sybase ASE 12.5.4 Enterprise Edition on Windows XP.
    I have written a stored procedure that actually writes to a physical file on hard drive. For this, I am using ASE_XFS feature.

    Data is successfully written to file. But I am not able to insert a new line character. I tried \n,\r,\r\n.
    Everything is written on same line.

    Following is sample code,

    set @vFileHeader = 'Data File Header' + '\n'
    insert into PT_PCDFILE values (@vFileHeader)

    Here PT_PCDFILE is a Proxy table that refers to some file like text1.txt.

    Thanks in advance! Does anyone has suggestion?

  2. #2
    Join Date
    Sep 2003
    Location
    Switzerland
    Posts
    443
    Quote Originally Posted by august97
    Hi All,

    set @vFileHeader = 'Data File Header' + '\n'
    insert into PT_PCDFILE values (@vFileHeader)

    Here PT_PCDFILE is a Proxy table that refers to some file like text1.txt.

    Thanks in advance! Does anyone has suggestion?
    I think in Windows new line is equiv to CR (Carriage Return) + (LF) LineFeed.

    Try char(13) instead of \n

  3. #3
    Join Date
    Nov 2007
    Posts
    13
    It worked! Thanks a lot!
    This problem had become a roadblock for me. Thanks again!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •