Options

Add Prefix or Suffix to attribute names in joined dataset?

tmyerstmyers Member Posts: 21 Contributor II
edited November 2018 in Help
Hi. I am joining 2 datasets into a single dataset. As each dataset has many attributes with odd names, I would like to distinguish in my final joined dataset the source of each attribute. I would like to add a prefix onto the attribute names in my final joined dataset identifying the original source of the attribute (for example, datasetA_att1, datasetB_att2, and so on).

Is there a way to do this without having to rename each individual attribute? My final joined datsaset has over 2000 attributes. :(

Thanks in advance for any advice-

Tim

Answers

  • Options
    mikeyharmsmikeyharms Member Posts: 13 Contributor II
    Hi Tim,

    This is very doable. You can use the Rename by Replacing operators pre-join for both datasets.

    attribute filter type = all (default anyway)
    replace what = (.*.)
    replace by = $1_set1 or $1_set2

    - The $1 takes everything that is captured in the parens in replace what.
    - .*. this is regular expression that says any character (.) any length (*)
  • Options
    tmyerstmyers Member Posts: 21 Contributor II
    Mikey, you're the best, works perfectly. Thank you so much!
  • Options
    mikeyharmsmikeyharms Member Posts: 13 Contributor II
    Glad it helped.
Sign In or Register to comment.