Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help needed to extract character position

Status
Not open for further replies.

blx

MIS
Oct 9, 2002
23
GB
Hi All,
An easy one for those in the know !!
I have hostnames of machines in my environment that can be displayed as either:

NTSNRTWK006
YSWWKFDS01

I want to be able to extract only machines that have WK as the 7th and 8th characters, and output them to a file.

Any ideas?

Thanks in Advance
Blx
 
"the command you use to list hosts"
Code:
 | grep '^......WK' > anOutputFile
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top