![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| 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 |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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. |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
cat messages.Each | grep message | grep "time_stamp" > file_messages
ex: cat messages.Each | grep "message" | grep "00:05" |
|
#3
|
|||
|
|||
|
Does this copy only the line containing the timestamp or the entire message content corresponding to each message?
|
|
#4
|
|||
|
|||
|
the lines with the messages and a particular timestamp
|
|||
| Google The UNIX and Linux Forums |