Advertisement

02.24.2006 at 11:29PM PST, ID: 21751240
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.8

awk search and replace

Asked by bryanlloydharris in Linux Programming

Tags: , ,

Hi,

Can someone write an awk command to do the following?  Is it possible to write this awk command from the command line only?  I want to extract the server names from a file, which has a certain format(line numbers are from vi, and aren't part of the file):

      9                  1       2-15    adobe <ping.cfm?server=adobe>           RedHat 7.2 CIH
     10  66.221.139.1    66.221.139.1 - 66.221.139.254           00:20:ED:26:16:27
     11  01/01/01               View details <details.cfm?server=adobe>         Edit this record
     12 <Loc_RecordEdit.cfm?RecordID=2718>      Delete this record
     13 <Loc_RecordDelete1.cfm?RecordID=2718>
     14   <63.cfm>       1       2-6     aloe <ping.cfm?server=aloe>     RedHat 5.2
     15  63.249.236.1    63.249.236.1 - 63.249.236.254           00:A0:CC:56:4B:10
     16  07/05/02               View details <details.cfm?server=aloe>  Edit this record

The file is much bigger, but in this piece I would want to extract the server names of adobe(on line 9 and 11) and aloe(on 14 and 16).  It's okay to have multiple lines which have the same server name because I could always use the uniq program in linux.  Does anybody know how to extract these?

If this would be easier, I was thinking I could use a certain vim command to delete all text up until a match is found.  I don't know if this makes sense, but if it is an alternative, it's just as good for me.  I'd just like to have the values in a text file.

Thanks!

BryanStart Free Trial
[+][-]02.24.2006 at 11:38PM PST, ID: 16044631

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.24.2006 at 11:41PM PST, ID: 16044636

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Linux Programming
Tags: awk, replace, search
Sign Up Now!
Solution Provided By: amit_g
Participating Experts: 1
Solution Grade: A
 
 
[+][-]02.24.2006 at 11:43PM PST, ID: 16044641

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 - Hierarchy