View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Little Penny[_2_] Little Penny[_2_] is offline
external usenet poster
 
Posts: 23
Default Import Data from txt file

Everyday I receive 50 to 100 text files containing a few lines of
information. I save all the files to a folder on my desktop. I'm
looking for a excel macro that will extract specific information from
each file then delete it. The files look as follows.

ICI_D243gdj_000056_VP5637X5

Indexs: 5
Text01: 8
IDHXC: 756352
RunName: VP5637X5

I want to extracted the "Indexs" and the "RunName" and import to
excel spreadsheet to look like this.

VP5637X5 5


I want to do this for each txt file in the designated folder and have
the results imported to the next row in my open the spreadsheet.

The data I received is not delimited but the format is always the
same. With the exception of the "Indexs" could be up to 7 digits.

Example:

ICI_D243gdj_000056_XW5637X6

Indexs: 7245691
Text01: 8
IDHXC: 756352
RunName: XW5637X6

VP5637X5 5
XW5637X6 7245691


Thanks for your Help

Larry