How to insert text in multiple attributes (in the beginning)?

ebayundsoebayundso MemberPosts:2Contributor I
edited August 2019 inHelp

Hi all,

i try to add text to all my values in one attrtibute, for example my values of attributes are:

Up

Polo

Beetle

Tiguan
Touran

Caddy
Golf

Passat

an they should add "VW" in the beginning:

VW Up

VW Polo

VW Beetle

VW Tiguan
VW Touran

VW Caddy
VW Golf

VW Passat

Do you have a solution for my problem?:)

Answers

  • Thomas_OttThomas_Ott RapidMiner Certified Analyst, RapidMiner Certified Expert, MemberPosts:1,761Unicorn

    I would use the Replace operator for that. You'd have to do a RegEx to select the word and then append it with VW.

    of the top of my head something like this (.*) to select it and replace it with VW $1

  • lionelderkrikorlionelderkrikor Moderator, RapidMiner Certified Analyst, MemberPosts:1,195Unicorn

    Hi@ebayundso,

    I don't know if it is the optimal solution, but it works :


































    Regards,

    Lionel

  • ebayundsoebayundso MemberPosts:2Contributor I

    Thomas_Ott这增加了“大众”in the beginning but also in the end...:(

  • Telcontar120Telcontar120 Moderator, RapidMiner Certified Analyst, RapidMiner Certified Expert, MemberPosts:1,635Unicorn

    Using "Generate Attributes" you can also create another attribute with the value VW (or other car manufacturers as needed) and then create a third attribute which concatenates the manufacturer and the model.

    Brian T.
    Lindon Ventures
    Data Science Consulting from Certified RapidMiner Experts
  • Edin_KlapicEdin_Klapic Moderator, Employee, RMResearcher, MemberPosts:299RM Data Scientist

    Hi@ebayundso,

    In the Parameterreplace whatthe RegEx characters ^ and $ have an additional meaning.

    If you use ^ as first character it means "Beginning". $ means "End"

    The RegEx would then be:

    Replace: ^(.*)$

    by: VW $1

    Happy Mining,

    Edin

Sign InorRegisterto comment.