![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How can i read a non text file in unix - ELF-64 executable object file - IA64 | alexcol | UNIX for Advanced & Expert Users | 8 | 11-07-2008 08:56 AM |
| how to read all the unique words in a text file | aditya.ece1985 | Shell Programming and Scripting | 5 | 11-30-2007 02:26 AM |
| read specific text from a log file | ragha81 | Shell Programming and Scripting | 4 | 10-17-2006 01:17 PM |
| appending string to text file based on search string | malaymaru | Shell Programming and Scripting | 1 | 06-09-2006 08:53 AM |
| need to read 3° character from a text file | piltrafa | UNIX for Dummies Questions & Answers | 15 | 07-26-2005 10:19 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Read text file from a specified string to the end
Hi All,
I like to read the log file from specific time to end of the file. eg: message date and time message 1 date and time1 message 2 EOF I want to read all the text (Messages) after date and time to end of the file. Please let me know the UNIX command to perform this?. Thanks, bsraj. |
|
||||
|
Hi,
Thanks for your response. I tried to using the shell script, but i am getting error because there are spaces in between the data and time. Can we able to get all the lines from the logfile after this string "2008 01 01 12:00:00"?. Thanks, bsraj |
|
||||
|
Hi,
Please find my sample code.. #! /bin/ksh set -x LogFile="/tmp/scan_log.log" LoadFile="/tmp/new_scan_log.log" Last_Alert="Alert: Fri Jan 4 16:15:01 2008" while read line do case $line in "$Last_Alert" ) f=1;; esac if [ $f -eq 1 ]; then echo "$line" >> $LoadFile fi done < "$LogFile" Thanks, bsraj |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|