All,
I have a flow that exports data to our SharePoint Site (documents). The flow also creates a folder based on current Date and uses Employee ID to name the file.
So Inside our SharePoint Site we will have multiple folders and files:
Share Point URL (example): https://test.sharepoint.com/sites/test/
Folder and File (example):
/Timesheet/TimesheetTest/01-24-2022/Employee101.cvs
/Timesheet/TimesheetTest/01-25-2022/Employee102.cvs
/Timesheet/TimesheetTest/02-24-2022/Employee103.cvs
Now I would like to create a new flow and combine all these files into one master Excel file.
All files have the same column's and none of these files are in table format.
Is this possible?
Employee101.xls
Hi - I've copied this solution to merge 2 CSV files into a new output file, but the header - first row - from the second still writes to the new file - I'm using the expressions shown here -
base64ToString(outputs('Get_file_content')?['body']['$content'])
skip(base64ToString(outputs('Get_file_content_2')?['body']['$content']),add(indexOf(base64ToString(outputs('Get_file_content_2')?['body']['$content']),variables('Enter')),1))
all else exactly the same - any ideas?
How did you use the loop to pick up all files?
Can you help me?...
I am stuck to bring all csv files using get files
@v-bofeng-msft - Hi, I have similar requirement and try to combine/append 4 csv files (File1.csv, File2.csv, File3.csv, File4.csv) in Sharepoint folder ( eg: /Shared Documents/General/CSVFiles) and create a master file in same sharepoint folder path. I understand that there should be 4 Get file content action to be created for each csv files. However, I am not quite sure as in what should be given in "File Identifier" field. Should that be ID as File Identifier from Dynamic content? Could you please help me with these details?
If you only have one sheet, and you know the total of lines, you can create a table on top of your file and them push the data into a string and put it into a csv file.
Source: https://www.youtube.com/watch?v=nGTRuqcpUM0
After that you combine the CSVs in a different flow (or the same flow, later)
After being stuck trying to find a solution that doesn't require any of the "API Services", this was the solution!
Thank you very much!
Note that both files need to be .csv otherwise when you try to convert to base64, the data will be corrupted. I didn't figure out a solution to merge .xlsx and .csv unfortunately.
This is brilliant @v-bofeng-msft - thank you! Is there a way to add a column with the original file name?
Hi @v-bofeng-msft ,
Thank you for the above solution.
I have a similar requirement but which needs to be an automatic flow.
Have folder 1,2,3,4,5 in a SharePoint and Excel files will get added with same header names and same number of columns with different data.
Requirement is to create a master file when a new gets added to any folder in the SharePoint..
Could you please provide a solution to implement this?
Hi @aishak12 :
In the solution I provided at the beginning there is a way to skip the first line
Best Regards,
Bof
Ok so this is my current flow and it is now working perfectly picking up all files and combining them.
But How do I skip the header (1st) row of all the files.
s
ok
stampcoin
55
Michael E. Gernaey
39
Super User 2025 Season 1
VictorIvanidze
26