Import Text File - CERTAIN COLUMNS ONLY

bauer24

New Member
Joined
Jan 12, 2009
Messages
23
Hi all,

Importing text files into excel is farely simple having googled round the topic. The text file i'm importing is awfully big though, so I wondered if I could just read in the columns I need to speed things up.

(I could import the whole thing then delete the columns I don't want after but that won't make the import stage any quicker)

So does anyone know how I can import just, say, the 1st,2nd, 4th and 10th columns for example?

cheers!!!!!
Dan
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Convert your text file to a .csv file. Open up excel and goto Data -> Import External Data -> New Database Query

Click on the 1st option (New Data Source) and click on OK.
Name your connection. (Example - Connect CSV). Select the driver to be Microsoft Text Driver (*.txt,*.csv) and click on connect.

Uncheck the use currect directory option and click on select directory. Browse to the directory that contains your CSV and click on OK. Click OK again and OK once more. You would be back to the Choose Data Source window. Select your newly made connection and click on ok. In the new window you would find your CSV already visible. Click ok the "+" to expand and select the columns you need and click the > button. Once all required columns are on the right side click Next, Next once more and sort it if you wish and click next. Click the option Return Data to Microsoft Excel and Click on Finish. You will be asked to select the column where you want your data pasted. Select the column and click OK.

Your data has been imported to excel.
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,917
Members
452,366
Latest member
TePunaBloke

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