When #(cf) wouldn't work for me, #(lf) did work. ie Line Feed
Replace carriage returns in a Power Query column?
I can find no way to replace a carriage return in Power Query column. This SHOULD work:
Result=Table.ReplaceValue(QtrInc,"#(#)(cr)"," ",Replacer.ReplaceText,{"AcctName"})
But it has no effect.
Instead of "#(#)(cr)" I've tried:
"#(#)(000D)"
"#(cr)"
"#(#)(000D)"
But they have no effect. I tried to split the column on the character, but still no joy.
Is this a bug? Or have I blundered?
3 answers
Sort by: Most helpful
-
-
Ron Rosenfeld 271 Reputation points
2021-09-09T19:40:37.967+00:00 "#(cr)" should work.
Are you absolutely certain you have carriage-return characters in the string?
When I try the replace here, it works flawlessly. -
Ron Rosenfeld 271 Reputation points
2021-09-10T00:49:31.927+00:00 Just replace it with a space:
eg:
let Source = Table.FromList( {"abc" & Character.FromNumber(13) & "def"}, Splitter.SplitByNothing(), {"Column1"} ), replaceCR = Table.ReplaceValue(Source,"#(cr)"," ",Replacer.ReplaceText,{"Column1"}) in replaceCR
Source
Replace CR