VBA- copy/paste data from a non-standard file extension

Js Smith

New Member
Joined
Jul 24, 2020
Messages
44
Office Version
  1. 2010
Platform
  1. Windows
Hi! I'm back trying to automate more menial manual data processing.

We have files from a vendor where they create txt files then add a .date extension at the end. I.E. on April 2 we got a file called data_file.txt.20230331and on May 22 we got a file called data_file.txt.20230519
I can't figure how to get at the data in these files to start manipulating it.
How do would you use the Application.GetOpenFilename() function to open these files with bad extensions and extract the data?

Once the data is in excel, I'm good to go. Thanks for your advice, as always!
 

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.
Honestly, I'd ask the vendor to change the way they name files. It's odd to have the date in the extension and not within the file name itself. i.e. data_file.txt.20230331 should be data_file_20230331.txt

If that is not possible, I'd look at renaming the files and then importing.
 
Upvote 0
Solution

Forum statistics

Threads
1,215,365
Messages
6,124,511
Members
449,166
Latest member
hokjock

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