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 / Removing a blank row a...
Power Automate
Unanswered

Removing a blank row at the end of a text file in sharepoint

(0) ShareShare
ReportReport
Posted on by 2

Hi all ,

 

I have created a flow as follows 

 

get rows from a sql query 

create csv table

create a text file on sharepoint with outputs if the create csv table 

 

the issue is it’s adding a blank row at the end of the file 

 

how do I remove this blank line at the end of the text file I checked the query it has no blank rows 

 

thank you all 

Categories:
I have the same question (0)
  • v-zhoqian-msft Profile Picture
    Microsoft Employee on at

    Hi @Syd89 ,

     

    Since the CSV table is a text separated by commas, does an extra blank line mean a few more commas? If that's the case, we can remove the last few commas from the CSV table by using some string functions. For example, if there are 5 fields, the formula would look like:

    substring(body('Create_CSV_table'),1,sub(length(body('Create_CSV_table')),5))
     
     
     

    Best Regards,

    Habsburg Qian

    If this post helps, then please consider Accept it as the solution to help the other members find it.

  • Syd89 Profile Picture
    2 on at

    Hi, 

    thank you for your reply but I think the issue is in the create text file block . It’s adding in a newline and a carriage return to the last row of the csv output. 

    that’s why the text file has a blank line at the end.

     

    Thank you 

    Syd2

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 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard