Combine all text in text files and save the file with a given name in new folder

jiobi

New Member
Joined
Feb 21, 2021
Messages
15
Office Version
  1. 2013
  2. 2011
  3. 2010
  4. 2007
Platform
  1. Windows
Combine all text in text files and save the file with a given name in a new folder
A. Location of multiple text files is from column A2 cell rows separated by a comma.
B. New file names are given in column B cell rows
C. Now save the file in a given folder location in column C Cell rows.
D. Some rows are empty
E. Some cells are empty
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
You can easily import all the text files in a folder using Power Query. Good videos from ExcelIsFun on the subject is Excel Power Query #04: Import Multiple CSV Files In 1 Step & Retrieve New Files Automatically and Excel Power Query #06: Import Multiple Excel Files From Folder Into One Excel Table or Data Model. The beauty of using PQ and Get Data From Folder is you only need to set it up once, and when new files are added to the folder, you only need to Refresh All to update the Table (or Pivot Table or Pivot Chart) you import the data to. Don't forget to first convert (Transform) all the file extensions to lower case and then filter for only ".csv". Using Power Query will save you hours of Cut-Copy/Paste! Learning how to use PQ is well worth the time.
 
Upvote 0

Forum statistics

Threads
1,214,644
Messages
6,120,709
Members
448,983
Latest member
Joaquim_Baptista

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top