04-14-2009
get the part of log between 2 string
Hi
Let's say I have a log file with this format:
Marker1
End of Marker1
....
Marker1
End of Marker1
....
Marker1
End of Marker1
how to get the last part between End of Marker1 and Marker1?
thanks
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi I am very new to KSH programming
and need some help with finding a string in an error log
currently i am doing
cat FTP_LOG.lis | grep Warning
which gives me
Warning: Authentication failed. Remaining authentication methods: 'publickey,pas
I want to only pick up the test between the... (4 Replies)
Discussion started by: DAFNIX
4 Replies
2. Shell Programming and Scripting
assuming "cat" is the pattern, string (regardless length)
asdadfcat4
I need to get 4
for eirtrjkkkcat678- I'd get 678
(in b-shell)
Thanks in advance!!! (4 Replies)
Discussion started by: bluemoon1
4 Replies
3. Programming
I need some help to divide an email address.
I need to grab the left part of the @. Maybe substr?
example:
john.smith@domain.com.br
I would need to grab just the username part...
my $user = "john.smith@domain.com.br";
if($user =~ s/@/\@/){
print "EMAIL: " .$user;
} (2 Replies)
Discussion started by: 4scriptmoni
2 Replies
4. Shell Programming and Scripting
Hi,
I have a string assinged to a varaible as below.
FILE=/var/adm/message
If $FILE is the value where it stores the path of message file.
I would like to extract the location of the file message as below
LOCATION=/var/adm
FILE may have value like /var/adm/xxxx/message
... (2 Replies)
Discussion started by: raghu.amilineni
2 Replies
5. Shell Programming and Scripting
Hi mates,
I am doing a script in ksh. I have the following string:
/opt/one/two/four/five/myFile.txt
And I have a variable:
echo "${variable}" -> /opt/one/two/
I would like to have just the string: four/five/myFile.txt
What is the better way to do that?
Thanks in... (3 Replies)
Discussion started by: gonzaloron
3 Replies
6. Shell Programming and Scripting
Hey there,
I'm searched for one day your forum for a similar solution. Didn't find one, sorry :(
Now here is what I'm searching for. I have the following multiple lines from a log (Edit: log name is SystemOut.log - this is not my day. I Apologize):
000042e2 1_BLA_Yab I logging.LogInfo... (5 Replies)
Discussion started by: nobodyhere
5 Replies
7. Shell Programming and Scripting
I have a string something like "/opt/src/default.cfg" OR /opt/src/common/one
This whole string stored in an array. The problem is this string is not constant and it will keep on changing as lot of strings are stored in the array and it will be look like :-
case 1
/opt/src/default.cfg ... (8 Replies)
Discussion started by: Renjesh
8 Replies
8. Shell Programming and Scripting
Hi guys got a problem here hope u all can help me. I learn that sed can actually edit a string but you need to know the old attribute to change to new 1.
Example: sed "s/$title:$author/$title:$Nauthor/g"
"Harry Potter - The Half Blood Prince:J.K Rowling:40.30:10:50"
Each delimiter : represent... (4 Replies)
Discussion started by: GQiang
4 Replies
9. Shell Programming and Scripting
i have something like this...
echo "teCertificateId" | awk -F'Id' '{ print $1 }' | awk -F'te' '{ print $2 }'
Certifica
the awk should remove 'te' only if it is present at the start of the string.. anywhere else it should ignore it.
expected output is
Certificate (7 Replies)
Discussion started by: vivek d r
7 Replies
10. Shell Programming and Scripting
Hi All,
Let us say we have 5 log files, extract the data from all log files and save the output in a file.
home/log/first.log
home/log/second.log
home/log/third.log
home/log/four.log
home/log/five.log
I want to extract the following text from the log files and save the output in a file.... (7 Replies)
Discussion started by: ROCK_PLSQL
7 Replies
LEARN ABOUT OSX
ppi::token::end
PPI::Token::End(3) User Contributed Perl Documentation PPI::Token::End(3)
NAME
PPI::Token::End - Completely useless content after the __END__ tag
INHERITANCE
PPI::Token::End
isa PPI::Token
isa PPI::Element
DESCRIPTION
If you've read PPI::Token::Whitespace, you should understand by now the concept of documents "floating in a sea of PPI::Token::Whitespace".
Well it doesn't after the __END__ tag.
Once you __END__, it's all over. Anything after that tag isn't even fit to be called whitespace. It just simply doesn't exist as far as
perl (the interpreter) is concerned.
That's not to say there isn't useful content. Most often people use the __END__ tag to hide POD content, so that perl never has to see it,
and presumably providing some small speed up.
That's fine. PPI likes POD. Any POD after the __END__ tag is parsed into valid PPI::Token::Pod tags as normal. This class, on the other
hand, is for "what's after __END__ when it isn't POD".
Basically, the completely worthless bits of the file :)
METHODS
This class has no method beyond what is provided by its PPI::Token and PPI::Element parent classes.
SUPPORT
See the support section in the main module.
AUTHOR
Adam Kennedy <adamk@cpan.org>
COPYRIGHT
Copyright 2001 - 2011 Adam Kennedy.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
perl v5.16.2 2011-02-25 PPI::Token::End(3)