Hi
I have a log file (say log.txt). I have to search for a line which has the string ( say ERROR) in the log file and copy 15 lines after this into another file (say error.txt). Can someone give me the code and this has to be in PERL
Thanks in advance
Ammu (3 Replies)
Hi everyone,
the problem is quite simple, yet I can't find an easy solution using awk.
I need to search for a string in $3, then if I find this string, copy the line,modify $3, and copy the next 9 lines to the same file.
My problem is in the copying of the lines... Finding and modifying... (5 Replies)
I'm trying to read an xml file and copy it line by line to another file and want to preserve the tabs.
What i'm trying to do is if I get to a certain line in the xml, I'm going to check to see if the next line is specifically what I want. If it's not, then I want to insert a single line of text... (4 Replies)
How to copy entire file content into another file being in last line mode of vi ?
---------- Post updated at 10:07 AM ---------- Previous update was at 09:56 AM ----------
Got it :
:1,30w file.txt (1 Reply)
I'm drawing blank on this. The log file I have is filled with garbage, but the important lines are ##/##/### Installation xxxxxxx
So, I want to sed the line to a new file IF the word installation is in it.
I tried removing none matching lines
sed 's/Installation/,//!d' infile > outfile
but that... (3 Replies)
How would you do vim copy line and paste at the beginning, middle, and end of another line. I know yy copies the whole line and p pastes the whole line, but on its own separate line. Sometimes I would like to copy a line to the beginning, middle, or end of another line. I would think this would be... (3 Replies)
Hi experts
cp bin root src /mnt
but not copy bin/bigfile
any help?
( I post this thread in the "redhat" forum wrongly, I don't know how to withdraw that question in that wrong forum)
Thanks (6 Replies)
I have a document m1 which contains a single line of text which I want to copy to the beginning of all lines in another document. How do I do this?? (4 Replies)
Hello All,
I am looking for help to achieve the following:
Here is the data set
1757890237|42|55570025|1468796400|0
1757890237|32|55570025|1471474800|0
1757890237|54|55570025|1474153200|1476745200
1757890237|34|55570026|1468796400|0
1757890237|44|55570026|1471474800|0... (7 Replies)
Discussion started by: angshuman
7 Replies
LEARN ABOUT SUSE
pdl::state
State(3) User Contributed Perl Documentation State(3)NAME
State - A package to keep track of plotting commands
SYNOPSIS
use PDL::Graphics::State;
DESCRIPTION
This is a very simple, at present almost trivial, package to keep track of the current set of plotting commands.
USAGE
You create a new object by calling the "new" operator
$state = PDL::Graphics::State->new();
Then for each new command you call "add" on this object so that for a call to "line" of the form
line $x, $y, $opt;
the call to "add" would be like
$state->add(&line, 'line', [$x, $y], $opt);
which is stored internally as:
[&line, 'line', [$x, $y], $opt]
The state can later be extracted using "get" which returns the state object which is an array of anonymous arrays like the one above where
the first object is a reference to the function, the second an anomymous array of arguments to the function and finally an anonymous hash
with options to the command.
If you know the order in which you inserted commands they can be removed by calling "remove" with the number in the stack. No further
interaction is implmented except "clear" which clears the stack and "copy" which returns a "deep" copy of the state.
AUTHOR
Jarle Brinchmann (jarle@astro.ox.ac.uk) after some prodding by Karl Glazebrook.
All rights reserved. There is no warranty. You are allowed to redistribute this software / documentation under certain conditions. For
details, see the file COPYING in the PDL distribution. If this file is separated from the PDL distribution, the copyright notice should be
included in the file.
perl v5.12.1 2009-10-17 State(3)