Advertisement

11.13.2008 at 05:09AM PST, ID: 23901572
[x]
Attachment Details

Grepping for a fixture ID and printing the 2 teams involved

[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!

7.6
Hello, I have a fixture file which looks something like the attached.

At the top of each file is a list of teams who are involved in at least one of the fixture below.

I currently have a grep which searches in each clients fixture file to confirm whether or not they have received a specific fixture ID. What I would like to do is be able to grep for a fixture ID and print an output something like;

Fixture ID: xxxxxxx
Team1 vs Team2

Clients;
client1
client2
client3
etc

At the moment all I get is;

Fixture ID: xxxxxxx

Clients;
client1
client2
client3
etc

What would be the best way of printing the related teams to the page too?
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
Fixture file;
 
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Fixtures SYSTEM "Fixtures.dtd">
<Fixtures sport="Soccer">
  <Teams>
    <Team id="65" name="Swansea" />
   <Team id="41" name="Watford" />
  <Fixture id="3072313" competitionId="301" stageNumber="1" roundNumber="5" leg="1" date="20081111" time="1945+0000" venue="Liberty Stadium" country="England
">
    <Participant teamId="65" />
    <Participant teamId="41" />
  </Fixture>
</Fixtures>
 
Script which runs the grep;
 
#!/bin/bash
echo
read -p "Enter the fixture id:" id
 
echo "These clients take fixture " $id
grep $id /usr/local/production/soccermatchplus/distributor/clients/*/out/fixtures.xml | awk -F/ '{print $8}'
 
 
 
Accepted Solution by mikelfritz:

All comments and solutions are available to Premium Service Members only. Start your 7-day free trial to view the solution to this question.

Already a member? Login to view this solution.

 
 
20081119-EE-VQP-46 - Hierarchy / EE_QW_2_20070628