How to accomplish this? Anyone


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How to accomplish this? Anyone
# 1  
Old 04-16-2008
How to accomplish this? Anyone

Hi All

I am new to Linux and Shell scripting. So bear with me.

I have two file the log.txt and the output.txt.
The log.txt looks like this
-------------------------------------------------------------------------
####
- r34327 | #####| 2008-03-31 10:18:35 -0400 (Mon, 31 Mar 2008) | 1 line Tag created for 00.04.11.04
- r34077 | #####| 2008-03-27 17:38:58 -0400 (Thu, 27 Mar 2008) | 3 lines Pilot CSC Inbound error fixed TeamTrack ID: D11237

#####
- r34327 | #######| 2008-03-31 10:18:35 -0400 (Mon, 31 Mar 2008) | 1 line 00.04.11.04
- r34193 | #######| 2008-03-28 10:29:17 -0400 (Fri, 28 Mar 2008) | 3 lines D09285 - Code change for Edit filtering TeamTrack ID:12345
-------------------------------------------------------------------------
The output.txt file looks like this. It contains the desscription of the ID's in log.txt. But the output file only contains the number not the whole TeamTrack ID
-------------------------------------------------------------------------
Defect/LifeCycle Mgmt/11237:CSC : Pilot: CrossSystemInbound Error
Fixed Release No: 11.02
search with some specific customers who are in 442 and another with 7932.
- 1 occured 2 days ago
- 2 occured yesterday
-------------------------------------------------------------------------
What i want to accomplish is write a script that searches for all the ID's in log.txt file and then retreives the information about the particular TeamTrack ID from the output.txt file and only get the first 3 lines and write it back in the log.txt next to the TeamTrack ID
E.g.
-------------------------------------------------------------------------
####
- r34327 | #####| 2008-03-31 10:18:35 -0400 (Mon, 31 Mar 2008) | 1 line Tag created for 00.04.11.04
- r34077 | #####| 2008-03-27 17:38:58 -0400 (Thu, 27 Mar 2008) | 3 lines Pilot CSC Inbound error fixed TeamTrack ID: 11237
Defect/LifeCycle Mgmt/11237:CSC : Pilot: CrossSystemInbound Error
Fixed Release No: 11.02
-------------------------------------------------------------------------
And do it for all the ID in the log.txt

can somebody point me to the right direction
Thank you
X
# 2  
Old 04-16-2008
pls use vB Codes when posting code or data samples. It's difficult to see the file format when posted as it was.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

2 More Discussions You Might Find Interesting

1. Red Hat

How to accomplish this?

Guys, I'm here again with more questions. I have been asked to perform the following in a few servers: Check: OS system messages review Non-intrusive tests of the hardware SAN and network(ports,bandwidth and firewall/load balancer checks Any input how to accomplish all this? ... (0 Replies)
Discussion started by: 300zxmuro
0 Replies

2. UNIX for Advanced & Expert Users

Any ideas how to accomplish this storage move?

We have a datacenter in another part of the country with about a 100Mb WAN between that datacenter and the local datacenter. The remoted datacenter has about 20TB of data on roughly 75 servers that all must be moved to this datacenter with minimal downtime. Please help me come up with the best way... (2 Replies)
Discussion started by: keelba
2 Replies
Login or Register to Ask a Question