Hitachi Vantara Pentaho Community Forums
Results 1 to 6 of 6

Thread: longtext data string cut logic

  1. #1
    Join Date
    Mar 2015
    Posts
    190

    Default longtext data string cut logic

    Hi Sir,Madam,

    Java 1.7, MySQL, Windows.

    below is my text in one of the column(Data type is longtext) in MySQL database. I should load the data only below highlighted blue colored data only. for all records below format is applicable, so i want to load data in between <p>....</p>. Could you please help on this which step is applicable for this scenario.

    if possible please tell me other steps instead of java script step.

    {"extensionList":[],"comments":[],"attachments":[],"format":"HTML","notificationFrom":"customercentral@m-ize.com","notificationTo":"kfisher@centralstatesbus.com","entityAsAttachment":"N","defns":[{"extensionList":[],"comments":[],"attachments":[],"subject":"update","body":"<p>Prompt supplier for shipping update will keep you posted. Thanks</p>"}],"intls":[],"links":[],"notifyToList":[]}
    Please ask me if you need more info.

    Thank you

  2. #2
    Join Date
    Aug 2015
    Posts
    313

    Default longtext data string cut logic

    Hi Sir,Madam,

    MySQL Innodb,Java 1.7, PDI 6.1

    I am trying to load the data in between <p>....</p> text(blue colored one only). I used String cut step but no luck for me, can you please tell me what is best approach/Step?

    {"extensionList":[],"comments":[],"attachments":[],"format":"HTML","notificationFrom":"customercentral@m-ize.com","notificationTo":"kfisher@centralstatesbus.com","entityAsAttachment":"N","defns":[{"extensionList":[],"comments":[],"attachments":[],"subject":"FW: part# 00127577","body":"<p>case as been setup as requested will advise. Thanks</p>"}],"intls":[],"links":[],"notifyToList":[]}


    Name:  image_1.jpg
Views: 49
Size:  11.7 KB

    Name:  image_2.jpg
Views: 52
Size:  16.1 KB

    Thank you

  3. #3
    Join Date
    Aug 2015
    Posts
    313

    Default string division

    Hi Sir,Madam,


    MySQL Innodb,Java 1.7, PDI 6.1


    I am trying to load the data in between <p>....</p> text(blue colored one only). I used String cut step but no luck for me, can you please tell me what is best approach/Step?


    {"extensionList":[],"comments":[],"attachments":[],"format":"HTML","notificationFrom":"customercentral@m-ize.com","notificationTo":"kfisher@centralstatesbus.com","entityAsAttachment":"N","defns":[{"extensionList":[],"comments":[],"attachments":[],"subject":"FW: part# 00127577","body":"<p>case as been setup as requested will advise. Thanks</p>"}],"intls":[],"links":[],"notifyToList":[]}






    Thank you

  4. #4
    Join Date
    Apr 2008
    Posts
    1,771

    Default

    You can try with the Regexp step and extract any character between <p> and </p>.
    -- Mick --

  5. #5
    Join Date
    Apr 2008
    Posts
    1,771

    Default

    Hi.
    Have a look at the attached ktr.
    One ktr uses a java step which is not very efficient.
    The second one has a couple of Regex step and Replace in String. There are more steps but it's probably more efficient and easier to understand.
    Attached Files Attached Files
    Last edited by Mick_data; 08-15-2017 at 05:21 AM. Reason: Added attachment and changed text
    -- Mick --

  6. #6
    Join Date
    Aug 2015
    Posts
    313

    Default

    Thank you very much Mike. It worked.

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.