Hi Folks,
I have a input file of the below format.
~~~OLKIT~OLKIT~1~~TBD~BEST PAGER & WIRELESS~4899 COMMON MARKET PLACE~~~DUBLIN~KS~43016~I~Y~DIRECT~D~~0
BPGRWRLS~~~OLKIT~OLKIT~1~~TBD~BEST PAGER & WIRELESS~4899 COMMON MARKET PLACE~~~DUBLIN~KS~43016~I~Y~DIRECT~D~~0... (12 Replies)
For counting the occurences of specific character in the file
I am issuing the command
grep -o 'character' filename | wc -w
It works in other shells but not in HP-UX as there is no option -o for grep.
What do I do now? (9 Replies)
In a file a pattern is occured many times randomly. Even it may appear more then once in the same line too. How i can get the number of times that pattern appeared in the file? let the file name is abc.txt and the pattern is "xyz".
I used the following code:
grep -ic "xyz" abc.txt
but it is... (3 Replies)
Hi all,
I have a pattern like this in a file:
123 4 56 789
234 5 67 789
121 3 56 789
222 4 65 789
321 6 90 100
478 8 40 789
243 7 80 789
How can I count the number of occurences of '789' (4th column) in this set...?
Thanks for all your help!
K (7 Replies)
We have a log file, the format is similar to this:
08/04/2011 05:03:08 Connection Success
08/04/2011 05:13:18 Connection Success
08/04/2011 05:23:28 Connection Fail
08/04/2011 05:33:38 Connection Success
08/04/2011 06:14:18 Connection Success
08/04/2011 06:24:28 Connection Fail
08/04/2011... (6 Replies)
hi,
I have a text..and i need to find a pattern in the text and count to the no of times the pattern occured.
i have used grep command ..but the problem is , it shows the occurrences of the pattern but doesn't count no of times the pattern occuries. (5 Replies)
Hi,
I have two files file1.txt and file2.txt. Please see the attachments.
In file2.txt (which actually is a diff output between two versions of file1.txt.), I extract the pattern corresponding to 1172c1172. Now ,In file1.txt I have to search for this pattern 1172c1172 and if found, I have to... (9 Replies)
I have a log file as given below
012/01/21 10:29:02 (111111) Processing Job '23_369468343464564'
2012/01/21 10:29:02 (111111)
Making Job '23_369468343464564.0'...
2012/01/21 10:29:04 (111111)
Jobnumber '23_369468343464564' was successful
2012/01/21 10:29:04 ... (12 Replies)
Hello,
I try to sort results of occurences in an array by using awk but I can't find the right command. that's why I'm asking your help ! :)
Please see below the command that I run:
awk '{ for ( i=1; i<=length; i++ ) arr++ }END{ for ( i in arr ) { print i, arr } }' dictionnary.txt
... (3 Replies)
Discussion started by: destin45
3 Replies
LEARN ABOUT OSX
base
base(3pm) Perl Programmers Reference Guide base(3pm)NAME
base - Establish an ISA relationship with base classes at compile time
SYNOPSIS
package Baz;
use base qw(Foo Bar);
DESCRIPTION
Unless you are using the "fields" pragma, consider this module discouraged in favor of the lighter-weight "parent".
Allows you to both load one or more modules, while setting up inheritance from those modules at the same time. Roughly similar in effect
to
package Baz;
BEGIN {
require Foo;
require Bar;
push @ISA, qw(Foo Bar);
}
When "base" tries to "require" a module, it will not die if it cannot find the module's file, but will die on any other error. After all
this, should your base class be empty, containing no symbols, "base" will die. This is useful for inheriting from classes in the same file
as yourself but where the filename does not match the base module name, like so:
# in Bar.pm
package Foo;
sub exclaim { "I can have such a thing?!" }
package Bar;
use base "Foo";
There is no Foo.pm, but because "Foo" defines a symbol (the "exclaim" subroutine), "base" will not die when the "require" fails to load
Foo.pm.
"base" will also initialize the fields if one of the base classes has it. Multiple inheritance of fields is NOT supported, if two or more
base classes each have inheritable fields the 'base' pragma will croak. See fields for a description of this feature.
The base class' "import" method is not called.
DIAGNOSTICS
Base class package "%s" is empty.
base.pm was unable to require the base package, because it was not found in your path.
Class 'Foo' tried to inherit from itself
Attempting to inherit from yourself generates a warning.
package Foo;
use base 'Foo';
HISTORY
This module was introduced with Perl 5.004_04.
CAVEATS
Due to the limitations of the implementation, you must use base before you declare any of your own fields.
SEE ALSO
fields
perl v5.16.2 2012-10-11 base(3pm)