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

Re: find account number in excel files by Tom

Tom
Thu May 08 12:35:38 CDT 2008

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/

Re: find account number in excel files by Richard

Richard
Thu May 08 13:31:23 CDT 2008


"Tom Lavedas" <tglbatch@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
--



Re: find account number in excel files by ginger8990

ginger8990
Thu May 08 13:54:02 CDT 2008

thank you Tom.
It is .XLS format. When I use the find bat file, I got access denied. A
particular script is needed.




"Tom Lavedas" wrote:

> 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/
>

Re: find account number in excel files by Tom

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/

Re: find account number in excel files by Tom

Tom
Thu May 08 14:37:23 CDT 2008

On May 8, 2:54 pm, ginger8990 <ginger8...@discussions.microsoft.com>
wrote:
> thank you Tom.
> It is .XLS format. When I use the find bat file, I got access denied. A
> particular script is needed.
>
{snip}

I don't think the access denied message is related to the find, unless
there is a syntax error in addressing the file, one of the files being
searched is in use or you don't have permission on the file.
Remember, you can get an error based on one single file, when you are
using a wildcard search, like the one you proposed.

As I said before, searching with a script is best accomplished having
some knowledge of the structure being searched. If the script has to
sniff out how many sheets there are, where the data is and all of the
particulars of the data structure, it will get very complicated. Too
complicated for a person offering free advice to get involved with, I
think.

Tom Lavedas
===========
http://members.cox.net/tglbatch/wsh/