Replace non-printing ASCII characters with a space

generalledger

New member
Joined
Oct 15, 2016
Messages
10
Reaction score
0
Points
0
Location
New Jersey, USA
Excel Version(s)
2016
I have a text field that sometimes contains non-printing characters such as line feeds and carriage returns. I used Clean to remove them. It works but the remaining text runs up against each other.

I should replace each non-printing character with a space. How do I do that?

I think the ASCII code for a carriage return is CHAR(13) and space is CHAR(32). Is there a way to Text.Replace each CHAR(13) with CHAR(32)?

Thank you very much!!
 
Right click column .. Replace values ... Advanced Options ... [x] Replace using special characters. Go to appropriate box then use [insert special character]
special.jpg

I believe the 5 characters generate these. Mix and match to needs

Code:
#"Replaced Value" = Table.ReplaceValue(Source,"#(cr)"," ",Replacer.ReplaceText,{"ColumnName"}),
#"Replaced Value" = Table.ReplaceValue(Source,"#(lf)"," ",Replacer.ReplaceText,{"ColumnName"}),
#"Replaced Value" = Table.ReplaceValue(Source,"#(cr)#(lf)"," ",Replacer.ReplaceText,{"ColumnName"}),
#"Replaced Value" = Table.ReplaceValue(Source,"#(tab)"," ",Replacer.ReplaceText,{"ColumnName"}),
#"Replaced Value" = Table.ReplaceValue(Source,"#(00A0)"," ",Replacer.ReplaceText,{"ColumnName"})
 
Last edited:
Back
Top