Extract file contents to excel

crgk1971

New Member
Joined
Mar 17, 2014
Messages
2
I have large number of sql files in various folders in my windows7 laptop.
I have extracted the file names with full path in column A in an excel work book.
For each row, I now need to parse the file and extract the file contents and put it in column B, for the respective row.
I want the entire query content to be populated in the row without parts of query to spillover to other column (based on comma etc in the query)
I am using excel 2007
Appreciate your help
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
For instance:

Code:
Sub wigi()

    For Each r In Columns(1).SpecialCells(2, 2)
        Open r.Text For Input As #1
        r.Offset(, 1).Value = Input(LOF(1), #1)
        Close #1
    Next

End Sub
 
Upvote 0

Forum statistics

Threads
1,215,332
Messages
6,124,314
Members
449,153
Latest member
JazzSingerNL

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