#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default 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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"