web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / I want to remove comma...
Power Automate
Answered

I want to remove comma separators when headers column is empty How can i do it using Power Automate Desktop.

(0) ShareShare
ReportReport
Posted on by 109

This is my excel data .

Name Age City
john 27 Denver 4-123 USA
Paul 20 Tokyo 8-985 Japan

The First row represents Headers, I converted into csv.

Now the data showing like that

Name,Age,City,,
john,27,Denver,4-123,USA
Paul,20,Tokyo,8-985,Japan

I want to remove comma separators (Red coloured Commas) when headers column is empty How can i do it using Power Automate Desktop.

  • eetuRobo Profile Picture
    4,607 Super User 2026 Season 2 on at

    If its always just two commas you could just simply use Replace text -action that replaces two commas with empty string. 

    eetuRobo_0-1717054214288.png

    Or if there can be more commas then with regex: ,{2,}

    eetuRobo_0-1717054561545.png

     

  • naidu1811 Profile Picture
    109 on at

    Hi @eetuRobo  ,Its not working. I want to remove commas more dynamically.

  • Verified answer
    eetuRobo Profile Picture
    4,607 Super User 2026 Season 2 on at

    Try with two replace text actions with regex:
    First replaces the more than one commas in a row to just one comma
    Regex: ,{2,}

    The second replaces commas that are at the end of the row
    Regex: ,(?=\r?\n|$)

    eetuRobo_1-1717071114363.png

    Result:

    eetuRobo_2-1717071171749.png

     

    You can copy Replace text actions here:

     

    Text.Replace Text: CsvVariable TextToFind: $''',{2,}''' IsRegEx: True IgnoreCase: False ReplaceWith: $''',''' ActivateEscapeSequences: False Result=> Replaced
    Text.Replace Text: Replaced TextToFind: $''',(?=\\r?\\n|$)''' IsRegEx: True IgnoreCase: False ReplaceWith: $'''%''%''' ActivateEscapeSequences: True Result=> Replaced

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 289

#2
11manish Profile Picture

11manish 288 Super User 2026 Season 2

#3
Henil Profile Picture

Henil 125

Last 30 days Overall leaderboard