How to Remove Extra Spaces using Power Query in Excel

How to Remove Extra Spaces using Power Query in Excel

Ajay Anand

4 года назад

11,164 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

GosCee
GosCee - 30.06.2023 22:50

Thank you for this, Ajay. How could I remove extra spaces from a column in a nested table before expanding the table?

Ответить
La Romania
La Romania - 20.12.2022 15:04

Dear how to remove spaces in number colomn

Ответить
chaswa68
chaswa68 - 30.10.2022 01:14

Thank you so much for publishing this. I managed to add a slight adjustment that helped me with my problem: to remove only multiple spaces and not single ones, the also to replace with a delimiter so I could then split the columns. It's not perfect but if anyone else needed this then here is that changed code. The delimiter is # in this case. I also put two spaces in the x function instead of one.
(text as text)=>
let
x = Text.Split(text," "),
y = List.Select(x,each _<>""),
z = Text.Combine(y,"#")
in
z

Ответить
Peter Pferd Productions
Peter Pferd Productions - 24.07.2022 23:49

Very helpfull for me, thank you very much! I tried with search for two spaces or more and replace with nothing like in MS Word "SPACE{2;}", but this did not work.

Ответить
ALBERTO RODRIGUEZ PEREZ-SILVA
ALBERTO RODRIGUEZ PEREZ-SILVA - 10.05.2022 18:39

Here it is the full trim code in case you want to use it ^^

(text as text)=>
let
x = Text.Split(text," "),
y = List.Select(x,each _<>""),
z = Text.Combine(y," ")
in
z

Thanks for the awesome video!

Ответить
Daniel Ubeda
Daniel Ubeda - 04.05.2022 00:46

Thanks man! Works like a charm!

Ответить
Parsa Hodjat
Parsa Hodjat - 22.03.2022 16:50

Very helpful! Works perfectly! Thank you very much!

Ответить
Rafael Pereira | Consultor de BI
Rafael Pereira | Consultor de BI - 08.03.2022 18:56

Pretty good solution. Thanks for sharing

Ответить
Mariusz Nowakowski
Mariusz Nowakowski - 01.01.2022 15:25

Awesome! Thank you!

Ответить
Krishna Kishore Malisetty
Krishna Kishore Malisetty - 17.12.2021 07:26

This is brillient Ajay!! thanks for sharing.

Ответить
Sally
Sally - 09.12.2021 01:43

It’s working with your method, awesome!! Thanks very much.

Ответить
Neto
Neto - 15.04.2021 08:47

Amazing

Ответить
Bijo Omalloor
Bijo Omalloor - 05.02.2021 18:35

Is there any short cut method for this instead of write program ..? Substitute funtion will remove all spaces including single space between words.. Trim will not remove space in between words.. So, is there any other function which will remove only extra spaces from a sentence..?

Ответить
paramjeet975 singh
paramjeet975 singh - 24.07.2020 13:43

sir is this possible with trim function

Ответить