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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / remove last character ...
Power Automate
Unanswered

remove last character from csv file

(0) ShareShare
ReportReport
Posted on by 11

Hello,

 

My CSV file has a unwanted comma at the end of each row which creates additional column in my subsequent process

 

Here is the sample data

 

Heading 1, Heading 2, Heading 3

1,2,3,

4,5,6,

7,8,9,

 

As you can see in the above example, I have 3 rows with one header. My value rows have comma at the end of each row which need to be trimmed. I tried but couldn't find a better way.

 

I tried the data operations in MS flow but couldn't get it all done 

Categories:
I have the same question (0)
  • tom_riha Profile Picture
    10,185 Most Valuable Professional on at

    Hello @KarthikKumarstp ,

    since it's a csv, I guess you're using split(...) by the end of the line character to split it into separate rows. Why don't you just add the comma to the split(...), instead of just the end of a line you can split it by comma and the end of the line (and then somehow remove the header).

  • Verified answer
    KarthikKumarstp Profile Picture
    11 on at

    Thanks for the response.. I finally accomplished this by simple replace function.

     

    Here is what I did

     

    1. Initialized two variables - one with comma and hard return and another with just hard return
    2. Using replace function replaced variable 1 with variable 2

    KarthikKumarstp_0-1634565439367.png

    replace(outputs('CSVtoString'),variables('var_newlinew_comma'),variables('var_newline'))

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 462 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 456 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard