Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Search & Extract various strings from many files to one excel file

Hi,
Any suggestions you can provide for me on this problem are very apppreciated.
I am trying to pull specific data from within a large number of files into
one single listing in an excel sheet. I have a list of files (approx. 1000)
that are saved without extensions or in some cases with meaningless
extensions. (e.g. .12n, .101, .m, etc.). The file name actually represents
a part number. I need to pull the complete file name of each file into one
column of excel. I also need to pull utilization data from each file and
place it in the corresponding row of the excel list. For example, the output
in excel would look something like this:

Filename Utilization
101222 0.67
1032.5n 0.55
10b55.1 0.76

Within each file, the utilization numbers are specified in various ways. In
some cases, the are following the text "SHEET UTILIZATION". In other cases,
they follow the text "Efficiency". There may be other cases as well. In
addition, in some cases there is no utilization number in the file - in which
case I would like to return "not available".
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default Search & Extract various strings from many files to one excel file

Question: given the file extensions and your description, I assume these
files are not Excel files but some kind of text format? What is the format -
are the comma delimited, or fixed width, or just free text?

You can iterate through the files and open them using the Open "FilePath"
for Input As #1 statement; then you can read it and somehow parse the
contents. But the difficulty is that the contents vary and sometimes it
seems in ways you may not be aware of. You need some logic that can be
followed to find that utilization number, but you say it comes after "SHEET
UTILIZATION" sometimes or "Efficiency" sometimes or who knows what. When you
know what comes before it it is easy to handle: search your input for "SHEET
UTILIZATION" or "Efficiency", find where this ends, and take the next set of
continuous characters. But how could you find it in those "who knows what"
cases? You need to either know where on the line it starts (nth character)
or what is directly before/after it, or perhaps by knowing something
distinctive about the format - is it the only number in the file that would
be in the format 00.0? Unless you have some logically consistent way you can
identify the number you cannot write code to find it.
--
- K Dales


"Boca J" wrote:

Hi,
Any suggestions you can provide for me on this problem are very apppreciated.
I am trying to pull specific data from within a large number of files into
one single listing in an excel sheet. I have a list of files (approx. 1000)
that are saved without extensions or in some cases with meaningless
extensions. (e.g. .12n, .101, .m, etc.). The file name actually represents
a part number. I need to pull the complete file name of each file into one
column of excel. I also need to pull utilization data from each file and
place it in the corresponding row of the excel list. For example, the output
in excel would look something like this:

Filename Utilization
101222 0.67
1032.5n 0.55
10b55.1 0.76

Within each file, the utilization numbers are specified in various ways. In
some cases, the are following the text "SHEET UTILIZATION". In other cases,
they follow the text "Efficiency". There may be other cases as well. In
addition, in some cases there is no utilization number in the file - in which
case I would like to return "not available".

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
file search or search files Richad Excel Discussion (Misc queries) 0 October 22nd 09 07:56 PM
In Excel 2003 I must do a file search to fine my files Doc Kass Excel Discussion (Misc queries) 0 June 14th 06 11:36 PM
how to extract decimal numbers from alphanumeric strings in Excel Old Tone Excel Discussion (Misc queries) 13 March 23rd 06 03:49 PM
Search/Extract Data w/in Text File D.Parker Excel Discussion (Misc queries) 4 June 21st 05 07:33 PM
Extract Data From Multiple Excel Files - One File Michael via OfficeKB.com Excel Programming 3 June 20th 05 08:24 PM


All times are GMT +1. The time now is 12:56 AM.

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

About Us

"It's about Microsoft Excel"