ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Help (https://www.excelbanter.com/excel-programming/351726-help.html)

Raslot[_2_]

Help
 

Can someone help me with : I need to import the second line of a .txt
file. And the second problem is i only know the first few letter of the
document name. Any tips on how to solve this matter.?


--
Raslot
------------------------------------------------------------------------
Raslot's Profile: http://www.excelforum.com/member.php...o&userid=30933
View this thread: http://www.excelforum.com/showthread...hreadid=506088


Gary''s Student

Help
 
1. Using the DIR command, create an index file containg all your possible
source files:
dir letter*.* C:\index.csv

2. Using VBA, open the index file and store the contents in an un-used
worksheet
3. Using VBA, open sequentially each source file and store the second line
of text in an un-used worksheet in column B. In column A store the name of
the candidate source file.
4. Using a human, scan column A to locate the correct filename and get the
text from the same row in column B
--
Gary''s Student


"Raslot" wrote:


Can someone help me with : I need to import the second line of a .txt
file. And the second problem is i only know the first few letter of the
document name. Any tips on how to solve this matter.?


--
Raslot
------------------------------------------------------------------------
Raslot's Profile: http://www.excelforum.com/member.php...o&userid=30933
View this thread: http://www.excelforum.com/showthread...hreadid=506088



Raslot[_3_]

Help
 

Ok so ive stored it in an index file, but how do i get VBA to open the
said file in a good way. Each row in the index file looks something
like this:

2006-01-01 17:26 5ÿ234 test.csv

When import it into excel using a normal import way that being
Data/Import file.
I get it to divide in
2006-01-01 | 17:26 | 5ÿ234 |
test.csv ( | = colums )

That being different colums. Problem that ive found doing this is that
files containing spaces within there name gets divided into 2 colums
and then i cant merge it.
The files that i want to open could be named starting with about 25
different words and there is no other files named like that. Is there a
way to create a register file for all those 25 words and then get vba to
look into the register file and then search the path for all files
starting with those words and just import them?


--
Raslot
------------------------------------------------------------------------
Raslot's Profile: http://www.excelforum.com/member.php...o&userid=30933
View this thread: http://www.excelforum.com/showthread...hreadid=506088



All times are GMT +1. The time now is 01:03 PM.

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