# remove all spaces from column headers in power query



## mschoular (May 10, 2017)

Hello.  How would I remove all spaces from all column headers in power query with a large table? i.e "Part Number" needs to be "PartNumber"

I have succeeded using a small table with 10 columns and 10 rows by:
demoting headers
transposing the table
adding a custom column with Text.Remove([Column1]," ")
then transposing the table back and promoting headers with the new custom column names that have the spaces removed

My issue is that I have a table with 40+ columns and 165000 rows.  the table is too large to transpose per the method above.

Any help would be appreciated.  I am new to PQ


----------



## gazpage (May 10, 2017)

Table.TransformColumnNames(Source, (columnName as text) as text => Text.Replace(columnName, " ", ""))


----------



## mschoular (May 10, 2017)

Thank you.  After a bit of messin' around, I was able to make the correct adjustments.  It works perfectly!!!


----------

