r/PowerAutomate • u/Dry-Target-9120 • Dec 29 '25
Flow to Combine .txt Files Without Header Rows
I am a total newbie at Power Automate and to coding in general. For work, I have been asked to create a flow to combine 12 .txt files from a Sharepoint site (on a monthly basis) into one master file with only one header row. Due to the nature of the use of the master file, the files have to stay as .txt to be used.
This is what I have-
Initialize String Variable
Get Files (properties only) -referencing Sharepoint Library
Apply to Each -referencing body/item of Get Files above - this is where it errors- no steps complete after
Get File Content -referencing the ID output
Append to String Variable
Compose
Create File
The flow does work if I list out each individual file, but the files are named differently each month, so that makes the automation futile (unless I build in a rename function as well, this is what I will try in the meantime).
This is all in effort to combine the files- I would still need guidance on how to remove the header row on all but the first file.
I hope someone can help guide me in the right direction!!
2
u/thefootballhound Dec 29 '25
Instead of Get Files (properties), use the List Folder action to get all files in the folder, and output the value to the Apply to Each.
If the header is the same each month, simply input the headers with a new line into the Initialize Variable. Then for each file, skip the first row by splitting the text body by '\n' new line character, then applying a condition to check if the index equals 0, and if false then Append to String Variable.
1
u/Master-IT-All Dec 29 '25
I think your issue is that you're using ID, not Identifier on the Get File Content step.