Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2014
    Posts
    4

    Question Unanswered: String Manipulation function

    Hi,
    I am new to this forum. I need help to extract values from the field in the table.

    Table1
    Field1 | Field2
    1,34,2,342,3 | test1
    23,1,43,24,2 | test2
    ...

    From the above table i need to extract the values like

    1, test1
    34, test1
    2, test1
    342, test1
    3, test1
    23, test2
    1, test2
    43, test2
    24, test2
    2,test2
    ...

    DB : Informix 11.5
    OS : Solaris
    Can any one provide me the query to extract as above mentioned output.

    Thanks in advance.

  2. #2
    Join Date
    Sep 2011
    Location
    Pont l'Abbé, Brittany, France
    Posts
    381
    Provided Answers: 1
    Code:
    unload to filename delimiter ","
    select field1,field
    from table1
    you will have to remove the ',' at the end of the line with a sed or awk command

    Regards
    Eric

  3. #3
    Join Date
    Feb 2014
    Posts
    4
    Thanks a lot for the reply.

Tags for this Thread

Posting Permissions

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