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
2
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

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.

jdellasala

New Member
Joined
Dec 11, 2020
Messages
10
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
  3. Web
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.
 

jiobi

New Member
Joined
Feb 21, 2021
Messages
2
Office Version
  1. 2013
  2. 2011
  3. 2010
  4. 2007
Platform
  1. Windows
VBA is preferred.
 

Forum statistics

Threads
1,136,863
Messages
5,678,205
Members
419,750
Latest member
crp

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
Top