Help Importing Text File

JTL9161

Well-known Member
Joined
Aug 29, 2012
Messages
567
Office Version
  1. 365
Platform
  1. Windows
I have fairly large daily text files of approximately 4000-5000 rows that I am importing into a worksheet then running a macro that looks for specific data in certain columns. I have about 40 different criteria I search for.

Problem is that the file size varies each day row wise as well as column wise. Using the Import Wizard Excel makes guesses where there columns should be yet based on the text within the text file Excel has different guesses each day an the columns that I am coding in my macro to search for the data are not always the same and even some data is split so my finds in the macro's do not work correctly since the columns are different than my practice import used to write the macro.

On the practice import I have columns all the way up to FF but within the macro I delete the columns down to about 25 to search for my data.

I was thinking of writing some code that would check to see if certain data has been imported to the correct columns thus knowing my macro will be searching for the correct finds in the filtered columns I have coded.

Just wondering if this is the way I need to go or is there another solution out there someone has.

I did try opening the text file with Excel which then puts each row starting in column A then I try text to columns but still the wizard guesses where the columns should be and thus I am not sure if my data & columns will be lined up correctly.

Any help will be appreciated.
James
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Fixed. As I said above it almost works down to one specific column that could have various text in it and depending on that text Excel can format 1 column or 5
 
Upvote 0

Forum statistics

Threads
1,214,929
Messages
6,122,317
Members
449,081
Latest member
tanurai

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