Power Query Replacing more than one comma

hatstand

Well-known Member
Joined
Mar 17, 2005
Messages
778
Office Version
  1. 2016
Platform
  1. Windows
Hi All,

I have a file with varying amounts of words and commas in each row. To tidy things up and place one comma in front of every word (later to be split by delimiter). I am replacing every pair of commas with a single commas until the job is done. My problem is that it takes 20 lines as per below to get the job done. Is there a simpler method like a ",*". Obviously this won't work and I'm not up to speed with M code yet. Thanks for any pointers.

#"Replaced Value7" = Table.ReplaceValue(#"Replaced Value6",",,,,",",",Replacer.ReplaceText,{"Column1"}),
 
Here's the M code for adding the new column.
Code:
Table.AddColumn(#"Changed Type", "ReplaceMultipleDelimiters", each ReplaceMultipleDelimiters([Column1], ","))

You could try incorporating that into the M code for the query that's pulling in the data.
 
Upvote 0

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest

Forum statistics

Threads
1,214,646
Messages
6,120,717
Members
448,985
Latest member
chocbudda

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top