1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| //Code créé par Chat GPT avec un peu d'aide pour le guider
//Et ce site pour Expression.Evaluate trouvé dnas les commentaires https://blog.crossjoin.co.uk/2018/09/23/converting-decimal-numbers-to-hexadecimal-in-power-query-m/
//Il permet de remplacer les codes _x0000_ par l'équivalent unicod
let
Fct_SP_Car_Hexa_To_String = (originalName as text) as text =>
let
Parts = Text.Split(originalName, "_x"),
Transformed = List.Transform(Parts, each
if Text.Length(_) >= 5 and Text.Range(_, 0, 4) = Text.Select(Text.Range(_, 0, 4), {"0".."9", "a".."f", "A".."F"}) then
Character.FromNumber(Expression.Evaluate("0x" & Text.Range(_, 0, 4))) & Text.Range(_, 5)
else
_
),
Result = Text.Combine(Transformed, "")
in
Result
in
Fct_SP_Car_Hexa_To_String |
Partager