LAE

Welcome to the LAE community!  Please feel free to start a discussion in the discussion tab or join in a conversation.

Discussions

Members

Resources

Events

 View Only

How to remove certain word with number in the entire column.

  • 1.  How to remove certain word with number in the entire column.

    Employee
    Posted 06-06-2016 05:47

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: Jagdev

    Hi,

    I have a column with addresses in it. I need to remove a word and number after that word from the entire column.

    Eg - ABC 245 1800 EFG Lane

    The word to be find and removed is ABC. I can accomplished removing Replace code, but I also want to delete the numbers (245 1800). the number after the word will keep on changing.

    Kindly guide me to do it.

    Regards,
    Jagdev


  • 2.  RE: How to remove certain word with number in the entire column.

    Employee
    Posted 06-06-2016 06:30

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: ryeh

    See the attached regex example. I'm looking for the pattern ABC and any numbers and spaces that follow it. In the second record, note that the numbers at the end do not get removed because it comes after non-matching characters.

    newData = Data.regexSubstitute("(ABC[ 0-9]{1,}).","")

    will turn:

    Data
    ABC 245 1800 EFG Lane
    ABC 245 1800 EFG Lane 123

    into:

    newData
    FG Lane
    FG Lane 123
    Attachments:
    removeString.brg


  • 3.  RE: How to remove certain word with number in the entire column.

    Employee
    Posted 06-06-2016 07:22

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: Jagdev

    Hi Ryeh,

    I am finding very strange output. When I am trying to add a sample data via static node it gives me the correct result, but when i am linking this filter node to filter node of my actual graph it is throwing an error msg.

    Regards,
    Jagdev


  • 4.  RE: How to remove certain word with number in the entire column.

    Employee
    Posted 06-06-2016 07:49

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: stonysmith

    What's the error message?


  • 5.  RE: How to remove certain word with number in the entire column.

    Employee
    Posted 06-06-2016 07:56

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: Jagdev

    Please find the error screenshot attached with the mail.

    In short when I am trying the below code:

    newData = Data.regexSubstitute("(ABC[ 0-9]{1,}).","")

    connecting data via excel or other nodes it is giving me an error.

    Regards,
    Jagdev
    Attachments:
    Untitled2.jpg


  • 6.  RE: How to remove certain word with number in the entire column.

    Employee
    Posted 06-06-2016 09:00

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: Jagdev

    Hi,

    Sorry guys, My data type in the data set was the issue. I fixed it now and it is working fine. Thanks for your patient on this.

    Regards,
    Jagdev


  • 7.  RE: How to remove certain word with number in the entire column.

    Employee
    Posted 06-06-2016 12:23

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: Jaronowitz

    Hello,

    In addition to the previous answer, I would like to suggest to use one of the accelerator nodes designed to solve this type of filtering.
    The accelerator is called "Easy Text Replace" and it allows to Find and replace a substring in a string field.

    For more information about Lavastorm Accelerator Library:
    http://community.lavastorm.com/threa...erator-Library


  • 8.  RE: How to remove certain word with number in the entire column.

    Employee
    Posted 06-14-2016 06:59

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: Jagdev

    Hi All,

    Thanks for your help on this thread.

    I need your help in the below case as well.

    1st Flr 01100 sample rd - to be - 01100 sample rd
    abcde 100-102 sample Rd - to be - abcde 100 sample Rd
    6730-37 W sample Rd - to be - 6730 W sample Rd

    Regards,
    Jagdev


  • 9.  RE: How to remove certain word with number in the entire column.

    Employee
    Posted 06-14-2016 07:35

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: ryeh

    The tricky thing here is to account for all cases, and making sure that one replacement/change doesn't conflict with another. I've attached an example here that seems to work okay with your three examples. I added a fourth address to account for street names with numbers in them, i.e. E 1st St.
    Attachments:
    Address Cleanup.brg


  • 10.  RE: How to remove certain word with number in the entire column.

    Employee
    Posted 06-14-2016 09:55

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: Jagdev

    Hi Ryeh,

    Thanks for the graph/circuit, but is it possible to accomplished the above with the code "regexSubstitute". I am trying the below code to
    1st Flr 01100 sample rd - to be - 01100 sample rd. I am able to remove only Flr from the entire string

    regexSubstitute("([0-9A-Z ]FLR{1,})","")

    Regards,
    Jagdev


  • 11.  RE: How to remove certain word with number in the entire column.

    Employee
    Posted 06-14-2016 10:03

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: ryeh

    Sure, try something like:

    NewAddress = Address.toUpper().regexSubstitute("([0-9A-Z ]{1,}FLR)","")

    The {1,} means you'll match any numbers, capital letters, and space of any length. (Note that I moved its position.)


  • 12.  RE: How to remove certain word with number in the entire column.

    Employee
    Posted 06-17-2016 09:01

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: Jagdev

    Hi Ryeh,

    Thanks for sharing the above information. This is really useful and informative,

    Thanks for all your help on this.

    Regards,
    Jagdev