How to Merge Text Files in Power Automate

Cloudmersive
3 min readNov 15, 2024

--

No matter what operating system we’re on, we can always write plain text content to a .txt file and save that file in our system. Different systems (like Linux and Windows, for example) will handle the line endings in text files differently, but beyond that, all .txt files are effectively identical.

Important information — including code, data, and myriad forms of written content — is often stored in .txt files to ensure it’s widely accessible and consumable for a wide range of different applications. Just like any other file, it makes sense to merge text files when they contain related content to combine relevant information and avoid clutter in our file system.

Merge Text Files in Power Automate

Thankfully, there’s an easy way to do that — and without writing any code. We can easily merge text files in Power Automate using the Cloudmersive Document Conversion connector, just like we can merge PDFs, Word documents, Excel workbooks, and PowerPoint presentations.

We’ll now run through a quick example Instant cloud flow that merges three text files together. Each file in my example contains a different Lorem Ipsum paragraph, and they’re located in different folders throughout my system.

We’ll start by adding Get file content actions for each text file we’re retrieving. In my example, I’m gathering files located in OneDrive for Business and SharePoint folders.

Next, we’ll add a new action and look for Cloudmersive connectors. To find the Cloudmersive Document Conversion connector, we’ll scroll down the list and look for the option with a green connector logo.

Once we find it, we’ll click “See more” to view the entire actions list, and from there, we’ll search for an action called Merge multiple text (TXT) files together.

If we’ve used this connector in the past, we’ll see the request parameters directly after selecting this action. If it’s our first time using this connector, we’ll need to create our connection and authorize it before we can configure our request. To authorize our connection, we’ll need a free API key (this allows 800 API calls per month) which we can get by creating a free account on the Cloudmersive website.

To configure our Merge text files request, we’ll add each set of file bytes into each respective Input file field. We’ll then add file names to accompany each set of file bytes (we don’t need the real file names for this action to work correctly).

While I’ve only included three files in my example, we can merge as many as 10 files using this connector action.

When we’ve finished configuring our request, we’ll add a Create file action to write our merged text contents to a new .txt file.

Now we can simply save and test our flow, and we’ll find our merged text file in the folder we specified. No further steps required!

--

--

Cloudmersive
Cloudmersive

Written by Cloudmersive

There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.

No responses yet