Hi All,
I have a quary regarding grep command in linux.
I have a file which contains
56677
56677
+56677
+56677
56677
56677
56677
I want to extract total count of "56677"
When I hit the following command
#cat filename | grep -w -c '56677'
the result comes 7. Its counting... (3 Replies)
Hi all,
Is anyone able to help with the following query?
I have an input file with several lines of words, e.g.
"hellolaylahello"
"hellohellohellolayla"
I want to search for the exact string "hello" in each line and display:
2 "hellolaylahello"
3 "hellohellohellolayla"
I... (11 Replies)
Hi there,
I've search this forum and find this problem could have been solved by,
grep -ho "num=*" input_data
The input_data is,
1\11\num1=100\num2=200\newnum1=220\\@
however, what I have got is ,
num1=100
num1=220
how to get the exact string, (4 Replies)
QUESTION1:
How do you grep only an exact string. I am using Solaris10 and do not have any GNU products installed.
Contents of car.txt
CAR1_KEY0
CAR1_KEY1
CAR2_KEY0
CAR2_KEY1
CAR1_KEY10
CURRENT COMMAND LINE: WHERE VARIABLE CAR_NUMBER=1 AND KEY_NUMBER=1
grep... (1 Reply)
I am attempting to grep an exact string from a series of files within a directory and append that output to the filename when it is present in the file. I've been after this all day with no luck. Thanks for your help in advance :wall:. (4 Replies)
This may be stupid question but not able to solve it.
How to grep exact word and line along with it.
TEST:/u00/app/oracle/product/10.2.0/TEST:N
TEST2:/u00/app/oracle/product/10.2.0/ODS:N
TEST3:/u00/app/oracle/product/10.2.0/TEST:N
TEST4:/u00/app/oracle/product/10.2.0/ODS:N... (4 Replies)
Hi ,
am getting output file, it sontains the below values.
./hawk_DOM1_FIRST_ENV
./hawk_DOM2_SECOND_ENV
./hawk_DOM3_THIRD_ENV
Now I need to grep the word "DOM1_FIRST_ENV","DOM2_SECOND_ENV"
like that.
I tired with cut -d "_". Its not working with any deleimiter.
Can you please help to... (3 Replies)
Hi all,
I tried searching the forum for this, and I read numerous suggestions here and even on other forums, and I cannot get this to want the way that I need it to. I tried grep -W / -f to no luck. Here is what I have. I have a list of file names-
FILE1-FILE1TEST,FILE1RELATION... (7 Replies)
Hi
I am trying to grep multiple exact word from log file and directing it to a new file.
however my log file has many numeric values, such as 0400, 0401, 0404
and all html error also starts with 404, 401 etc
so I just want to grep only when 404, 401 etc is coming, NOT 0400, OR 0401
i have... (8 Replies)
Hi All,
i want exact math to search to find it and i tried as like below it not working.
My Excepted out : should not get the output that mean exact word math.
echo "test.txt|123"|sed 's/|/ /g'|grep -w "test"
Thanks (1 Reply)
Discussion started by: bmk123
1 Replies
LEARN ABOUT OSX
tap::parser::source
TAP::Parser::Source(3pm) Perl Programmers Reference Guide TAP::Parser::Source(3pm)NAME
TAP::Parser::Source - a TAP source & meta data about it
VERSION
Version 3.23
SYNOPSIS
use TAP::Parser::Source;
my $source = TAP::Parser::Source->new;
$source->raw( 'reference to raw TAP source' )
->config( \%config )
->merge( $boolean )
->switches( @switches )
->test_args( @args )
->assemble_meta;
do { ... } if $source->meta->{is_file};
# see assemble_meta for a full list of data available
DESCRIPTION
A TAP source is something that produces a stream of TAP for the parser to consume, such as an executable file, a text file, an archive, an
IO handle, a database, etc. "TAP::Parser::Source"s encapsulate these raw sources, and provide some useful meta data about them. They are
used by TAP::Parser::SourceHandlers, which do whatever is required to produce & capture a stream of TAP from the raw source, and package it
up in a TAP::Parser::Iterator for the parser to consume.
Unless you're writing a new TAP::Parser::SourceHandler, a plugin or subclassing TAP::Parser, you probably won't need to use this module
directly.
METHODS
Class Methods
"new"
my $source = TAP::Parser::Source->new;
Returns a new "TAP::Parser::Source" object.
Instance Methods
"raw"
my $raw = $source->raw;
$source->raw( $some_value );
Chaining getter/setter for the raw TAP source. This is a reference, as it may contain large amounts of data (eg: raw TAP).
"meta"
my $meta = $source->meta;
$source->meta({ %some_value });
Chaining getter/setter for meta data about the source. This defaults to an empty hashref. See "assemble_meta" for more info.
"has_meta"
True if the source has meta data.
"config"
my $config = $source->config;
$source->config({ %some_value });
Chaining getter/setter for the source's configuration, if any has been provided by the user. How it's used is up to you. This defaults to
an empty hashref. See "config_for" for more info.
"merge"
my $merge = $source->merge;
$source->config( $bool );
Chaining getter/setter for the flag that dictates whether STDOUT and STDERR should be merged (where appropriate). Defaults to undef.
"switches"
my $switches = $source->switches;
$source->config([ @switches ]);
Chaining getter/setter for the list of command-line switches that should be passed to the source (where appropriate). Defaults to undef.
"test_args"
my $test_args = $source->test_args;
$source->config([ @test_args ]);
Chaining getter/setter for the list of command-line arguments that should be passed to the source (where appropriate). Defaults to undef.
"assemble_meta"
my $meta = $source->assemble_meta;
Gathers meta data about the "raw" source, stashes it in "meta" and returns it as a hashref. This is done so that the
TAP::Parser::SourceHandlers don't have to repeat common checks. Currently this includes:
is_scalar => $bool,
is_hash => $bool,
is_array => $bool,
# for scalars:
length => $n
has_newlines => $bool
# only done if the scalar looks like a filename
is_file => $bool,
is_dir => $bool,
is_symlink => $bool,
file => {
# only done if the scalar looks like a filename
basename => $string, # including ext
dir => $string,
ext => $string,
lc_ext => $string,
# system checks
exists => $bool,
stat => [ ... ], # perldoc -f stat
empty => $bool,
size => $n,
text => $bool,
binary => $bool,
read => $bool,
write => $bool,
execute => $bool,
setuid => $bool,
setgid => $bool,
sticky => $bool,
is_file => $bool,
is_dir => $bool,
is_symlink => $bool,
# only done if the file's a symlink
lstat => [ ... ], # perldoc -f lstat
# only done if the file's a readable text file
shebang => $first_line,
}
# for arrays:
size => $n,
"shebang"
Get the shebang line for a script file.
my $shebang = TAP::Parser::Source->shebang( $some_script );
May be called as a class method
"config_for"
my $config = $source->config_for( $class );
Returns "config" for the $class given. Class names may be fully qualified or abbreviated, eg:
# these are equivalent
$source->config_for( 'Perl' );
$source->config_for( 'TAP::Parser::SourceHandler::Perl' );
If a fully qualified $class is given, its abbreviated version is checked first.
AUTHORS
Steve Purkis.
SEE ALSO
TAP::Object, TAP::Parser, TAP::Parser::IteratorFactory, TAP::Parser::SourceHandler
perl v5.16.2 2012-10-25 TAP::Parser::Source(3pm)