2 Replies Latest reply on Apr 3, 2015 4:00 AM by Chandan.291

    REG: Split data on CRLF and Length of 10 characters

    Chandan.291

      Dear All,

       

      Oracle Database 11g R2 11.2.0.1 SE1

       

      Consider the below table which has 3 rows  

      ADDRESS
      aaaaaaaaaaaaaaaaaaaaaaaaaCRLFbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbCRLFcccccccccccccccCRLFddddd
      eeeeCRLFffffffffffffgggggggghCRLF
      iiCRLFjjjjjjjjjjkkkCRLF

       

      I need to split the string based on the below conditions

      Condition 1: Split string up-to CRLF.

      Condition 2: If length of the split string is greater than 10, then split that string by length of 10 characters.

      The length of a data is not fixed.


       

        RESULT:-

      ADDRESS
      aaaaaaaaaa
      aaaaaaaaaa
      aaaaaCRLF
      bbbbbbbbbb
      bbbbbbbbbb
      bbbbbbbbbb
      bbCRLF
      cccccccccc
      cccccCRLF
      ddddd
      eeeeCRLF
      ffffffffff
      ffgggggggg
      hCRLF
      iiCRLF
      jjjjjjjjjj
      kkkCRLF