Tom
Thu May 08 14:29:00 CDT 2008
On May 8, 2:31 pm, "Richard Mueller [MVP]" <rlmueller-
nos...@ameritech.nospam.net> wrote:
> "Tom Lavedas" <tglba...@cox.net> wrote in message
>
> news:b78b4c1d-9ee1-4d90-b0c5-e60c47cd667c@b1g2000hsg.googlegroups.com...
>
>
>
> > On May 8, 12:45 pm, ginger8990 <ginger8...@discussions.microsoft.com>
> > wrote:
> >> I am looking for a script to find only "account Number" in some excel
> >> files.
> >> I tried to use simply bat file such as
> >> Find /C "ACCOUNT NUMBER" "D:\data\ *.* "d:\find.txt"
>
> >> First it didn't work and find 0
> >> second it gets access denied on the network drive even at local server
> >> which
> >> the drives sits.
>
> >> Any input is welcome and appreciated!
>
> >> G
>
> > Is this a .XLS formatted file? FIND is intended for searching text
> > files, while Excel files typically have a lot of binary items in
> > them. Still, if you only want to prove a file has the string "ACCOUNT
> > NUMBER" in it, it should still work. However, it really can't tell
> > you anything about where it is in the file or what else might be in
> > the 'row' containing that string, because the file's internal
> > structure is not 'line' oriented.
>
> > From the syntax of the command as you show, it appears you only want
> > the count of the matches and you want them stored in the output file
> > find.txt in the root of the D: drive. If that's indeed what you're
> > after, this *should* work ...
>
> > Find /C "ACCOUNT NUMBER" "D:\data\*.xls" > "d:\find.txt"
>
> > Note that this is a case sensitive search. If the string is "Account
> > Number", it will not be found. This, of course needs to be keyed in
> > at a command prompt. It can be run from a VBS script, but more coding
> > would be needed.
>
> > If you really want to search inside the file for anything more, like
> > what an account number IS, then you will need to write a script to
> > access the Excel.Application object and either process the cells in
> > the file or perform a translation to a text format, CSV. Then the
> > FIND will be able to extract lines of date that match your criteria.
> > In either case, some knowledge of the internal structure of the file
> > would be very helpful in making the search/translation.
>
> > Tom Lavedas
> > ===========
> >
http://members.cox.net/tglbatch/wsh/
>
> I can't find any text in my *.xls files. Even strings seem to be in binary.
> I need to code the Excel.Application object to find anything.
>
> --
> Richard Mueller
> MVP Directory Services
> Hilltop Lab -
http://www.rlmueller.net
> --
I really though the same thing at first, but I tried one file and it
was full of text - maybe because there were no formulas, I don't
know. I am in Office 2003.
Tom Lavedas
===========
http://members.cox.net/tglbatch/wsh/