Skip to main content

Notifications

Community site session details

Community site session details

Session Id : E6aROKoBiQOJUklCFt7dHy
Power Automate - Building Flows
Answered

Combining txt files into one text file from an Array in Power Automate.

Like (0) ShareShare
ReportReport
Posted on 2 Apr 2024 16:24:18 by 47

Hello!

 

Thank you all so much for reading this!

 

I've struggled with Googling this problem, I don't want to use a 3rd party power automate library to do this.

 

I've noticed that I'm seeing a lot of help for merging into PDF and merging WORD documents on google.

Which is frustrating for me as I only want to combine text files! 

 

I guess because no one uses text files anymore? It shouldn't be too complicated ? I'm overcomplicating this?

 

I have an array within my power automate flow which contains text files like so :

 

array.png

APPEND TO ARRAY VARIABLE

 

NAME : FILE ARRAY

VALIE : {
"source_file_content": @{body('Get_file_content')}
}

 

How can I merge the array text files together and save them as one text file?

 

Many thanks for your help!

  • SuperDude123 Profile Picture
    47 on 03 Apr 2024 at 12:35:52
    Re: Combining txt files into one text file from an Array in Power Automate.

    The above link helped me to solve my problem so I have marked as solution. Hopefully this will help other users. Please go ahead and take time to view the above link.

  • Verified answer
    SuperDude123 Profile Picture
    47 on 03 Apr 2024 at 08:52:39
    Re: Combining txt files into one text file from an Array in Power Automate.

    https://powerusers.microsoft.com/t5/Building-Flows/Combine-CSV-Files-in-SharePoint-Folder-Into-One-Master-File/td-p/1430267

     

    I am currently looking at this to see if it can be adapted to my needs. I think the problem is that when I google for solution, all examples show a fixed array length. As you readers will know already that the array could be of any length depending on the number of files within the sharepoint document folder.

     

    I will experiment with this link above and see if I can make sense of implementing this into a loop.

  • SuperDude123 Profile Picture
    47 on 03 Apr 2024 at 07:18:09
    Re: Combining txt files into one text file from an Array in Power Automate.

    Hello Tomac and thanks for the reply.

    So the files I am merging are in a sharepoint site folder.

    I wish to merge all the text files together in date order. Each file is one month of logs.

    So there will be will be files named as follows.

    2024-01.txt

    2024-02.txt

    2024-03.txt

    I have another document folder in Sharepoint which I will drop the merged file to.

    So far my flow looks like this. I trigger saving the monthly log file via an email. This saves the file to document library in sharepoint.

    Flow1.pngFlow2.png

  • CU07041117-0 Profile Picture
    219 Super User 2025 Season 1 on 02 Apr 2024 at 18:26:04
    Re: Combining txt files into one text file from an Array in Power Automate.

    Hi! I need a bit more information about your goal to assist. Are you looking to store the text file in SharePoint/OneDrive or are you looking to have a single array with the text files for use in your Flow?

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,670 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,015 Most Valuable Professional

Leaderboard