Computing.Net > Forums > Disk Operating System > FINDSTR command

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

FINDSTR command

Reply to Message Icon

Name: DaveyBoy
Date: September 24, 2003 at 19:17:20 Pacific
OS: nt
CPU/Ram: various
Comment:

For WinNT I’ve done a batch file that will:
1] ping the PCs [by NetBios name] in our offices and the default gateways
2] open explorer to show the contents of a specific file that we need for our work

Of course the explorer window is a GRAPHICAL representation of this data.

Now what I need to do is modify the batch so that:
3] it shows a non-graphic TEXTUAL representation

I’ve got most of it by doing a DIR cmd to send the output to a text file. That’s ok but I need to do a few other things and I’m stuck.

The output of the DIR to the text file contains additional info that I don’t want. The info that I do want is an Axxxxxx and an Sxxxxxxx that will be different for each file output. By the way these Axxxxxx and an Sxxxxxxx that I’m searching for are DIRECTORY NAMES not file names.

The xxxxxx’s after the “A” will be 6 numerical digits that as I say vary.

The xxxxxxx’s after the “S” will be a combination of letters and also numerical digits.

I’ve tried the FINDSTR command to pull these out and send to yet another text file and that ONLY works if I put in the exact Axxxxxx or the Sxxxxxxx I’m looking for.

In other words it appears that the FINDSTR won’t work with any wildcards because if I put in FINDSTR A?????? or S??????? it won’t find them.

If anyone can help me, I thank you in advance. If you want the batch file I have so far, I’ll gladly send it to you.
DaveyBoy
David Bohm
dbohm@allstate.com [work]
Bohm320@aol.com [home]
[330-606-9755 cell}



Sponsored Link
Ads by Google

Response Number 1
Name: IVO
Date: September 25, 2003 at 02:21:49 Pacific
Reply:

Check your mail in-box.
May be you got the solution.


0

Response Number 2
Name: uli_glueck
Date: September 26, 2003 at 04:39:13 Pacific
Reply:

Maybe this helps.
I use it to filter pc names of netview in a txt file

FOR /f "skip=2 delims=\ " %%a in ('find "HA3" netview.txt') do echo %%a

This is seeking all words beginning with HA3.
skip=2 means not to seek in the first two lines (not necessary)
delims=\ " means just to give out what is between \(at the beginning and empty at the end of the word your seeking for).
Instead of echo you can use whatever you want.

I need it cause \\ha3xx username is in the list to filter out ha3xx in a loop.

It would be great to get your batch file

greetings
uli

ulrich.glueck@t-online.de


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: FINDSTR command

how do you do a search in DOS? www.computing.net/answers/dos/how-do-you-do-a-search-in-dos/10351.html

The FIND command www.computing.net/answers/dos/the-find-command/13233.html

Need help in For /f command www.computing.net/answers/dos/need-help-in-for-f-command/16865.html