locked
Problem with regexReplace and replace RRS feed

  • Question

  • In Azure data factory "Author and Monitor":

    When in the data flow section and adding an import of e.g. a CSV file, we want to do a projection, e.g. using a select block, where we transform all column names based on a regex rule that removes all whitespace an illegal characters. We use a rule-based mapping that usees regexReplace on all column names ($$) using this regex: ^[a-zA-Z0-9]. The problem is that it only deals with the first match. When under the Data Preview tab, we try to do data preview, it works fine, but when we click the inspect spectacles next to the rule based mapping, it does not work. This has the consequence that the validator complains that the column names are not correct.

    Monday, September 23, 2019 7:09 AM

All replies

  • Hi there,

    Here's a beautifully written blog in how to Create rules to modify column names

    Please have a look at it and let us know if it helps. If not, we can gladly continue the dialogue.

    Disclaimer- The above suggested blog is not an official blog by Microsoft.

    Monday, September 23, 2019 8:59 AM
  • regexReplace($$, `[^a-zA-Z0-9]`, '') = $$ should work. Notice backtick for regex
    Thursday, September 26, 2019 5:09 AM
  • Hi there,

    Just wanted to check - was the above suggestion helpful to you? If yes, please consider upvoting and/or marking it as answer. This would help other community members reading this thread.
    Thursday, September 26, 2019 10:13 AM
  • Hi there,

    We haven't heard from you in quite some time. Was your issue resolved?

    Thursday, October 3, 2019 11:22 AM