ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Import data from the middle of a text file (https://www.excelbanter.com/excel-programming/338727-import-data-middle-text-file.html)

Caol D

Import data from the middle of a text file
 
I want to import a range of data from a text file into Excel. I can specify
the starting row, but can't find a way to specify the ending row. Is it
possible to do this? Does anybody have code that will do it?

Tom Ogilvy

Import data from the middle of a text file
 
Why not just delete the rows you don't want after it is imported?

What method are you using (post the code)

--
Regards,
Tom Ogilvy

"Caol D" <Caol wrote in message
...
I want to import a range of data from a text file into Excel. I can

specify
the starting row, but can't find a way to specify the ending row. Is it
possible to do this? Does anybody have code that will do it?




Carol D

Import data from the middle of a text file
 
Yes, I can do that, but I will be working with hundreds of files with
thousands of rows of data.
For example, I have files with 8K rows, and only want to use a range of 100
rows.

I'm trying to find a way to not have to import so much data in the first
place.

Carol

"Tom Ogilvy" wrote:

Why not just delete the rows you don't want after it is imported?

What method are you using (post the code)

--
Regards,
Tom Ogilvy

"Caol D" <Caol wrote in message
...
I want to import a range of data from a text file into Excel. I can

specify
the starting row, but can't find a way to specify the ending row. Is it
possible to do this? Does anybody have code that will do it?





Jim Thomlinson[_4_]

Import data from the middle of a text file
 
How do you know which lines you want to import. It seems to me you either
have to traverse the text file line by line to determine what you need or you
might be able to get away with an ADO recordset. Check out this link

http://www.erlandsendata.no/english/...adacconnstring

to find the connection string to use to connect to a text file.
--
HTH...

Jim Thomlinson


"Carol D" wrote:

Yes, I can do that, but I will be working with hundreds of files with
thousands of rows of data.
For example, I have files with 8K rows, and only want to use a range of 100
rows.

I'm trying to find a way to not have to import so much data in the first
place.

Carol

"Tom Ogilvy" wrote:

Why not just delete the rows you don't want after it is imported?

What method are you using (post the code)

--
Regards,
Tom Ogilvy

"Caol D" <Caol wrote in message
...
I want to import a range of data from a text file into Excel. I can

specify
the starting row, but can't find a way to specify the ending row. Is it
possible to do this? Does anybody have code that will do it?





Carol D

Import data from the middle of a text file
 
I have about 200 "types" of data files. Each type has a specific number of
rows. I have a matrix that will tell me what range of lines to extract for
each "type" of file.

Thanks for the link. I think I can use the information there to do what I
need to do.

"Jim Thomlinson" wrote:

How do you know which lines you want to import. It seems to me you either
have to traverse the text file line by line to determine what you need or you
might be able to get away with an ADO recordset. Check out this link

http://www.erlandsendata.no/english/...adacconnstring

to find the connection string to use to connect to a text file.
--
HTH...

Jim Thomlinson


"Carol D" wrote:

Yes, I can do that, but I will be working with hundreds of files with
thousands of rows of data.
For example, I have files with 8K rows, and only want to use a range of 100
rows.

I'm trying to find a way to not have to import so much data in the first
place.

Carol

"Tom Ogilvy" wrote:

Why not just delete the rows you don't want after it is imported?

What method are you using (post the code)

--
Regards,
Tom Ogilvy

"Caol D" <Caol wrote in message
...
I want to import a range of data from a text file into Excel. I can
specify
the starting row, but can't find a way to specify the ending row. Is it
possible to do this? Does anybody have code that will do it?





All times are GMT +1. The time now is 02:16 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com