Combine Text Files from a Folder in Excel 2016
Question details
The user wants to combine text files from a folder into one Excel worksheet and refresh the data weekly.

- Product
- Microsoft Excel 2016 Power Query
- Device & OS
- not provided
- Scenario
- Append two text files into a single data range for a PivotTable, with updates when the source files change.
- Observed behavior
- The folder query initially displays file names and metadata rather than the contents of the text files.
Place the text files in a dedicated folder and check that they have compatible columns, headers, and delimiters. Remove unrelated files from the folder so they are not included in the query.
Combine folder files with Power Query in Excel 2016
Use the folder connector to append compatible text files and load their contents into a worksheet.
In Excel, select Data > New Query > From File > From Folder. Browse to the folder and confirm the selection.
When the file list appears, select Edit. The rows show file names and metadata, while the Content column contains each file's data.
Select the combine-files double-arrow icon in the Content column. If prompted, choose a sample file and set the appropriate delimiter and other import options.
Review the combined columns in Power Query Editor, adjust headers or data types if needed, and select Home > Close & Load to load the results into Excel.
Select a cell in the loaded table and choose Insert > PivotTable. After updating the source files, use Data > Refresh All; if the PivotTable does not reflect the updated query, right-click it and select Refresh.

Work with spreadsheet data in WPS Office
WPS Office is a free, lightweight alternative with a familiar spreadsheet interface. Open compatible Excel files and work with imported tabular data as you move between office suites. It does not fix Excel's Power Query folder connector.

Frequently Asked Questions
Why does the folder query show file names instead of file contents?
The folder connector first lists files and their metadata. Select Edit, then use the combine-files icon in the Content column to open and combine their contents.
Do the source files have to be CSV files?
No. Power Query can also combine other delimited text files, such as TXT files. Choose the correct delimiter during import and ensure the files have compatible structures.
How do I update the combined data each week?
Update or add compatible files in the same source folder, open the workbook, and select Data > Refresh All. Refresh the PivotTable separately if it does not reflect the updated query.
What should I check if the combined columns look wrong?
Open the query in Power Query Editor and check the delimiter, headers, and data types. Also confirm that the source files use compatible columns and contain no unrelated files.




