Dears,
i want cut the lines from a log file. Example of the log file as follows..
In that, i want to cut the lines based on timestamp and want to save the result into another file.This files is copied and overwriting from another machine every day and i want to get the only those line which is created since last change.
Please help.
Last edited by radoulov; 06-06-2011 at 06:01 AM..
Reason: Code tags.
Hi,
I have a text file contaning around 150 lines, each line is a hostname.
I want to read 4 lines/hostnames and save those 4 lines to a seperate file.
say the big file is /files/bigfile and I want to have a lot of files in /files named
/files/smallfile.1 , /files/smallfile.2 and so on...
... (1 Reply)
All, I have a file that I want to read, cut 12 lines and direct into a new file, and continue to do this until I reach the EOF. How do I do it?
can I use cat or read to do this?
the file is formated with repetitive output consisting of these 12 lines
date: <Timestamp>
dev_id: <device ID>... (7 Replies)
i have been doing this script to match every line in a current log file (access_log) with strings that i list from a path (consist of 100 of user's name ex: meggae )..
and then make a directory of every string from the text file (/path/meggae/) --->if it matched..
then print every line from the... (3 Replies)
Hi Everyone,
I have a file a.txt, inside is
Mon Jul 20 00:05:07 2009 12
Mon Jul 20 00:05:08 2009 1
The output should be a.txt, inside is
00:05:07 12
00:05:08 1
My method is
`cat a.txt | cut -f4,6 -d' ' > a.txt.tmp;mv -rf a.txt.tmp a.txt`;
Is any good way to do this? like perl... (5 Replies)
Sir
I have a data file e.g. DATA31082009. This file consists of several data files appended to that file. The size of each data file is different. The first line of each file starts with "44". I want to grep data from "44" to the preceding line of next "44" and save it as a individual file.... (10 Replies)
Hi,
I have a log file (updates.log), and I want to hunt the file for any errors. Here's an example of the log file:
SQL> update <table1> set <value1> = '*****';
update <table1> set <value1> = '*****'
*
ERROR at line 1:
ORA-00942: table or view does not exist
Elapsed:... (4 Replies)
I have a text file which has blank lines. I want them to be removed before upload it to DB using SQL *Loader. Below is the command line, i use to remove blank lines.
sed '/^ *$/d' /loc/test.txt
If i use the below command to replace the file after removing the blank lines, it replace the... (6 Replies)
Hi, all
I have a csv file that I would like to remove duplicate lines based on 1st field and sort them by the 1st field. If there are more than 1 line which is same on the 1st field, I want to keep the first line of them and remove the rest. I think I have to use uniq or something, but I still... (8 Replies)
Hello good day
I would like to know what is the difference between these two commands please
both warrant the output in the file
echo " ORACLE_SID : $ORACLE_SID" | tee -a $logfile
echo " ORACLE_SID : $ORACLE_SID" > $logfile (3 Replies)
Discussion started by: tricampeon81
3 Replies
LEARN ABOUT DEBIAN
test::pod::content
Test::Pod::Content(3pm) User Contributed Perl Documentation Test::Pod::Content(3pm)NAME
Test::Pod::Content - Test a Pod's content
SYNOPSIS
use Test::Pod::Content tests => 3;
pod_section_is 'Test::Pod::Content' , 'NAME', "Test::Pod::Content - Test a Pod's content", 'NAME section';
pod_section_like 'Test/Pod/Content.pm', 'SYNOPSIS', qr{ use s Test::Pod::Content; }xm, 'SYNOPSIS section';
pod_section_like 'Test/Pod/Content.pm', 'DESCRIPTION', qr{ Test::Pod::Content s provides s the }xm, 'DESCRIPTION section';
DESCRIPTION
This is a very simple module for testing a Pod's content. It is mainly intended for testing the content of generated Pod - that is, the Pod
included in perl modules generated by some mechanism.
Another usage example is to test whether all files contain the same copyright notice:
plan tests => scalar @filelist;
for my $file (sort @filelist) {
pod_section_like( $file, 'LICENSE AND COPYRIGHT', qr{
This s library s is s free s software. s
You s may s distribute/modify s it s under s
the s same s terms s as s perl s itself
}xms, "$file License notice");
}
See the files in the t/ directory for live examples.
Test::Pod::Content has a very simple concept of Pods: To Test::Pod::Content, a Pod is separated into section. Each section starts with a
=head(1|2|3|4) directive, and ends with the next =head, or with the end of the document (=cut).
This is a very drastic simplification of Pod's document object model, and only allows for coarse-grained tests.
Test::Pod::Content provides the following subroutines for testing a Pod's content:
SUBROUTINES /METHODS
pod_section_is
pod_section_is $file, $section, $content, $comment;
Tests whether a Pod section contains exactly the text given. Most useful for testing the NAME section. You probably want to use
pod_section_like for all other sections.
$file may either be a filename (including path) or a module name. Test::Pod::Content will search in @INC for the file/module given.
pod_section_like
pod_section_like $file, $section, qr{ use s Test::Pod::Contents }xm, $comment;
Tests whether the text in a Pod section matches the given regex. Be sure to include the m / s regex qualifier if you expect your Pod
section to span multiple lines.
$file may either be a filename (including path) or a module name. Test::Pod::Content will search in @INC for the file/module given.
BUGS AND LIMITATIONS
o Performance
Every call to a pod_section_* method searches for the file in question in @INC and parses it from its start. This means that every test
requires a Pod parser run, which is quite inefficient if you conduct a big number of tests.
o Pod Syntax
Test::Pod::Coverage may report wrong test results if your pod is not syntactically correct. You should use Test::Pod to check your
Pod's syntax.
DEPENDENCIES
Test::More
Pod::Simple
version
INCOMPATIBILITIES
None known
SEE ALSO
Test::Pod for testing your POD's validity
Test::Pod::Coverage for checking wether your pod is complete
Pod::Tests, Test::Pod::Snippets and Pod::Snippets for extracting and executing tests from a POD (If you plan doing so, here's a little
brain-train: Which of the tests in this module's "SYNOPSIS" section would fail if you extracted and executed it?).
LICENSE AND COPYRIGHT
Copyright 2007 Martin Kutter.
This library is free software. You may distribute/modify it under the same terms as perl itself
AUTHOR
Martin Kutter <martin.kutter fen-net.de>
REPOSITORY INFORMATION
$Id: Content.pm 505 2008-06-22 09:54:54Z kutterma $
$Revision: 505 $
$Source: a $
$Date: 2008-06-22 11:54:54 +0200 (So, 22 Jun 2008) $
$HeadURL: http://svn.hyper-framework.org/Hyper/Test-Pod-Content/trunk/lib/Test/Pod/Content.pm $
perl v5.12.4 2011-11-09 Test::Pod::Content(3pm)