Power Query, HTML Sonderzeichen ersetzen


neue Abfrage erstellen, Name fxReplaceHTMLEntities

--- SCHNIPP --- 

(inputText as text) as text =>

    let

        // Liste der zu ersetzenden HTML-Sonderzeichen und deren Entsprechungen

        HtmlEntities = [

            #"%20" = " ",

            #"%21" = "!",

            #"%22" = """",

            #"%23" = "#",

            #"%24" = "$",

            #"%25" = "%",

            #"%26" = "&",

            #"%27" = "'",

            #"%28" = "(",

            #"%29" = ")",

            #"%2A" = "*",

            #"%2B" = "+",

            #"%2C" = ",",

            #"%2D" = "-",

            #"%2E" = ".",

            #"%2F" = "/",

            #"%C3%A4" = "ä",

            #"%C3%BC" = "ü",

            #"%C3%B6" = "ö",

            #"%C3%96" = "Ö",

            #"%C3%9C" = "Ü",

            #"%C3%84" = "Ä"

            ],

        // Ersetzen der HTML-Sonderzeichen

        ReplaceEntities = List.Accumulate(

            Record.FieldNames(HtmlEntities),

            inputText,

            (state, current) => Text.Replace(state, current, Record.Field(HtmlEntities, current))

        )

    in

        ReplaceEntities


--- SCHNAPP ---

Kommentare

Beliebte Posts aus diesem Blog

Dropdown Liste mit Mehrfachauswahl

Vergleich mit 2 Bedingungen, INDEX(), VERGLEICH()

nützliche Text Funktionen in Power Query