LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Closed Thread
  Search this Thread
Old 04-15-2008, 12:35 PM   #1
Xossarian
LQ Newbie
 
Registered: Apr 2008
Location: RI
Distribution: Suse
Posts: 2

Rep: Reputation: 0
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 ID: 11237

#####
- 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 ID:12345
-------------------------------------------------------------------------
The output.txt file looks like this. It contains the desscription of the ID's in log.txt
-------------------------------------------------------------------------
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 ID from the output.txt file and only get the first two lines and write it back in the log.txt next to the 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 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
Xossarian

Last edited by Xossarian; 04-15-2008 at 12:43 PM.
 
Old 04-15-2008, 07:38 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread should be closed because it is a duplicate of the one in the Programming forum, IIRC.

Please don't do that again.
 
Old 04-15-2008, 08:04 PM   #3
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Closed per above; see link below
http://www.linuxquestions.org/questi...h-this-635537/
 
  


Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Advise to accomplish triple-boot installation jorgeluis Linux - General 2 11-16-2007 07:07 PM
I am probably the first ever to accomplish this, Cards_STL LinuxQuestions.org Member Success Stories 13 10-31-2005 03:07 AM
How can i accomplish this ? Drogo Linux - Software 2 10-17-2003 04:38 AM
Trying to accomplish something which I thought was pretty basic.... a5150a Linux - Newbie 6 08-02-2003 07:46 PM
Need a command to accomplish... infamous41md Linux - General 1 05-19-2003 03:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration