The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Shell script to search for text in a file and copy file imeadows UNIX for Dummies Questions & Answers 9 3 Weeks Ago 06:12 PM
exporting number into .csv file in text form (no other extra charc) from shell script Deepak_Rastogi Shell Programming and Scripting 5 03-13-2008 01:08 PM
Need Shell Script to upload data from Text file to Oracle database chandrashekharj Shell Programming and Scripting 6 03-26-2007 12:21 AM
Can a shell script pull the first word (or nth word) off each line of a text file? tricky Shell Programming and Scripting 5 08-17-2006 03:29 AM
How to input username on text file into finger command on shell script Micz Shell Programming and Scripting 3 11-07-2005 11:38 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 02-04-2008
Registered User
 

Join Date: Feb 2008
Posts: 7
Shell script for text extraction from a file

Hi All,


I am new to Shell Scripting.

I have a file consisting of XML messages.Each message is associated with a timestamp value(it is not a xml field).I need to extract\copy all messages in a particular time interval and put in another new file using Shell Scripting. My XML looks like this.

2008-01-27 00:05:00 (2008-01-27 00:05:00.055000000Z): message={Data="<?xml version="1.0" encoding="UTF-8"?>
<Envelope>
<Header>
....
....
</Header>
<Body>
....
....
</Body>
</Envelope>"
2008-01-27 00:05:12 (2008-01-27 00:05:12.055000000Z): message={Data="<?xml version="1.0" encoding="UTF-8"?>
<Envelope>
<Header>
....
....
</Header>
<Body>
....
....
</Body>
</Envelope>"

Any code/example is welcome.


Thanks,
Vignesh.
Reply With Quote
Forum Sponsor
  #2  
Old 02-04-2008
Registered User
 

Join Date: Jan 2007
Posts: 25
cat messages.Each | grep message | grep "time_stamp" > file_messages

ex: cat messages.Each | grep "message" | grep "00:05"
Reply With Quote
  #3  
Old 02-05-2008
Registered User
 

Join Date: Feb 2008
Posts: 7
Does this copy only the line containing the timestamp or the entire message content corresponding to each message?
Reply With Quote
  #4  
Old 02-05-2008
Registered User
 

Join Date: Jan 2007
Posts: 25
the lines with the messages and a particular timestamp
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 06:50 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0