Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: Catch a specific pattern

  1. #1
    Join Date
    Feb 2017
    Posts
    8

    Default Catch a specific pattern

    Hi!

    I have a problem and i hope that you can help me!

    I have a file with this records:

    C,10001,10001
    V,http://www.microsoft.com/regwiz,1
    V,http://www.microsoft.com/support,1
    V,http://www.microsoft.com/athome,1
    C,10002,10002
    V,http://www.microsoft.com/support,1
    V,http://www.microsoft.com/kb,1

    What i want to do is everytime that i identify a line that starts with "C", the next lines that starts with "V" change the last field of that lines to the last field of the "C" line.
    In the case before, the final output that i want to have is:

    C,10001,10001
    V,http://www.microsoft.com/regwiz,10001
    V,http://www.microsoft.com/support,10001
    V,http://www.microsoft.com/athome,10001
    C,10002,10002
    V,http://www.microsoft.com/support,10002
    V,http://www.microsoft.com/kb,10002

    I hope that you understand the problem! Sorry for my English!
    Thank you for helping

  2. #2
    Join Date
    Feb 2017
    Posts
    8

    Default String operations

    Hi!

    I have a problem and i hope that you can help me!

    I have a file with this records:

    C,10001,10001
    V,http://www.microsoft.com/regwiz,1
    V,http://www.microsoft.com/support,1
    V,http://www.microsoft.com/athome,1
    C,10002,10002
    V,http://www.microsoft.com/support,1
    V,http://www.microsoft.com/kb,1

    What i want to do is everytime that i identify a line that starts with "C", the next lines that starts with "V" change the last field of that lines to the last field of the "C" line.
    In the case before, the final output that i want to have is:

    C,10001,10001
    V,http://www.microsoft.com/regwiz,10001
    V,http://www.microsoft.com/support,10001
    V,http://www.microsoft.com/athome,10001
    C,10002,10002
    V,http://www.microsoft.com/support,10002
    V,http://www.microsoft.com/kb,10002

    I hope that you understand the problem! Sorry for my English!
    Thank you for helping

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.