Sponsored Content
Full Discussion: Grep word search
Top Forums Shell Programming and Scripting Grep word search Post 302479507 by skcvasanth on Saturday 11th of December 2010 02:25:27 AM
Old 12-11-2010
Hi Scrutinzer,

Great!
Your code works as per my requirement. Thanks a lot for everyone!

Vasanth.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

grep -w Search for the expression as a word

I have a file (file1) with around 5000 records and another file (file2) with 50000 records. I want to search each word in file 1 from file 2 and spew the output of the matches in file3. Can someone please help me here. I tried doing this in ksh for i in `cat file1` do grep -w $i... (15 Replies)
Discussion started by: knijjar
15 Replies

2. Shell Programming and Scripting

Grep Search for both First and last word

Hi Pretty sure this is very simple hence im banging my head o the wall as to why i cant get this to work: Im greping against many files where there will be the following string: Date: Thu, Aug 23 2001 09:27 PM (of course values such as date ,time and PM/AM will vary.) Im trying to grep... (1 Reply)
Discussion started by: duonut
1 Replies

3. Shell Programming and Scripting

Search the word to be deleted and delete lines above this word starting from P1 to P3

Hi, I have to search a word in a text file and then I have to delete lines above from the word searched . For eg suppose the file is like this: Records P1 10,23423432 ,77:1 ,234:2 P2 10,9089004 ,77:1 ,234:2 ,87:123 ,9898:2 P3 456456 P1 :123,456456546 P2 abc:324234 (2 Replies)
Discussion started by: vsachan
2 Replies

4. UNIX for Dummies Questions & Answers

Script to search for a particular word in files and print the word and path name

Hi, i am new to unix shell scripting and i need a script which would search for a particular word in all the files present in a directory. The output should have the word and file path name. For example: "word" "path name". Thanks for the reply in adv,:) (3 Replies)
Discussion started by: virtual_45
3 Replies

5. Shell Programming and Scripting

Search for the word and exporting 35 characters after that word using shell script?

I have a file input.txt which have loads of weird characters, html tags and useful materials. I want to display 35 characters after the word description excluding weird characters like $$#$#@$#@***$# and without html tags in the new file output.txt. Help me. Thanx in advance. My final goal is to... (11 Replies)
Discussion started by: sachit adhikari
11 Replies

6. Shell Programming and Scripting

Search for the word and exporting 35 characters after that word using shell script

I have a file input.txt which have loads of weird characters, html tags and useful materials. I want to display 35 characters after the word "description" excluding weird characters like $&lmp and without html tags in the new file output.txt. Help me. Thanx in advance. I have attached the input... (4 Replies)
Discussion started by: sachit adhikari
4 Replies

7. Shell Programming and Scripting

[Solved] Search for a word and print the next word

Hi, I am trying to search for a word and print the next word. For example: My text is "<TRANSFORMATION TYPE ="Lookup Procedure">" I am searching for "TYPE" and trying to print ="Lookup Procedure" I have written a code like following: echo $line | nawk... (4 Replies)
Discussion started by: sampoorna
4 Replies

8. Linux

How to search multiple word using grep command?

How to search multiple word using grep command for example i want to reserch ANJ001 AA Using ridiculous font, size, and color changes instead of normal space separated text and CODE tags obfuscates what you are trying to do and makes it difficult for volunteers who may want to help you solve... (1 Reply)
Discussion started by: na.dharma
1 Replies

9. Shell Programming and Scripting

Search for a specific word and print only the word from the input file

Hi, I have a sample file as shown below, I am looking for sed or any command which prints the complete word only from the input file. Ex: $ cat "sample.log" I am searching for a word which is present in this file We can do a pattern search using grep but I need to cut only the word which... (1 Reply)
Discussion started by: mohan_kumarcs
1 Replies

10. UNIX for Beginners Questions & Answers

How to search for a word in column header that fully matches the word not partially in awk?

I have a multicolumn text file with header in the first row like this The headers are stored in an array called . which contains I want to search for each elements of this array from that multicolumn text file. And I am using this awk approach for ii in ${hdr} do gawk -vcol="$ii" -F... (1 Reply)
Discussion started by: Atta
1 Replies
MRO::Compat(3)						User Contributed Perl Documentation					    MRO::Compat(3)

NAME
MRO::Compat - mro::* interface compatibility for Perls < 5.9.5 SYNOPSIS
package PPP; use base qw/Exporter/; package X; use base qw/PPP/; package Y; use base qw/PPP/; package Z; use base qw/PPP/; package FooClass; use base qw/X Y Z/; package main; use MRO::Compat; my $linear = mro::get_linear_isa('FooClass'); print join(q{, }, @$linear); # Prints: FooClass, X, PPP, Exporter, Y, Z DESCRIPTION
The "mro" namespace provides several utilities for dealing with method resolution order and method caching in general in Perl 5.9.5 and higher. This module provides those interfaces for earlier versions of Perl (back to 5.6.0 anyways). It is a harmless no-op to use this module on 5.9.5+. That is to say, code which properly uses MRO::Compat will work unmodified on both older Perls and 5.9.5+. If you're writing a piece of software that would like to use the parts of 5.9.5+'s mro:: interfaces that are supported here, and you want compatibility with older Perls, this is the module for you. Some parts of this code will work better and/or faster with Class::C3::XS installed (which is an optional prereq of Class::C3, which is in turn a prereq of this package), but it's not a requirement. This module never exports any functions. All calls must be fully qualified with the "mro::" prefix. The interface documentation here serves only as a quick reference of what the function basically does, and what differences between MRO::Compat and 5.9.5+ one should look out for. The main docs in 5.9.5's mro are the real interface docs, and contain a lot of other useful information. Functions mro::get_linear_isa($classname[, $type]) Returns an arrayref which is the linearized "ISA" of the given class. Uses whichever MRO is currently in effect for that class by default, or the given MRO (either "c3" or "dfs" if specified as $type). The linearized ISA of a class is a single ordered list of all of the classes that would be visited in the process of resolving a method on the given class, starting with itself. It does not include any duplicate entries. Note that "UNIVERSAL" (and any members of "UNIVERSAL"'s MRO) are not part of the MRO of a class, even though all classes implicitly inherit methods from "UNIVERSAL" and its parents. mro::import This allows the "use mro 'dfs'" and "use mro 'c3'" syntaxes, providing you "use MRO::Compat" first. Please see the "USING C3" section for additional details. mro::set_mro($classname, $type) Sets the mro of $classname to one of the types "dfs" or "c3". Please see the "USING C3" section for additional details. mro::get_mro($classname) Returns the MRO of the given class (either "c3" or "dfs"). It considers any Class::C3-using class to have C3 MRO even before Class::C3::initialize() is called. mro::get_isarev($classname) Returns an arrayref of classes who are subclasses of the given classname. In other words, classes in whose @ISA hierarchy we appear, no matter how indirectly. This is much slower on pre-5.9.5 Perls with MRO::Compat than it is on 5.9.5+, as it has to search the entire package namespace. mro::is_universal($classname) Returns a boolean status indicating whether or not the given classname is either "UNIVERSAL" itself, or one of "UNIVERSAL"'s parents by @ISA inheritance. Any class for which this function returns true is "universal" in the sense that all classes potentially inherit methods from it. mro::invalidate_all_method_caches Increments "PL_sub_generation", which invalidates method caching in all packages. Please note that this is rarely necessary, unless you are dealing with a situation which is known to confuse Perl's method caching. mro::method_changed_in($classname) Invalidates the method cache of any classes dependent on the given class. In MRO::Compat on pre-5.9.5 Perls, this is an alias for "mro::invalidate_all_method_caches" above, as pre-5.9.5 Perls have no other way to do this. It will still enforce the requirement that you pass it a classname, for compatibility. Please note that this is rarely necessary, unless you are dealing with a situation which is known to confuse Perl's method caching. mro::get_pkg_gen($classname) Returns an integer which is incremented every time a local method of or the @ISA of the given package changes on Perl 5.9.5+. On earlier Perls with this MRO::Compat module, it will probably increment a lot more often than necessary. USING C3 While this module makes the 5.9.5+ syntaxes "use mro 'c3'" and "mro::set_mro("Foo", 'c3')" available on older Perls, it does so merely by passing off the work to Class::C3. It does not remove the need for you to call "Class::C3::initialize()", "Class::C3::reinitialize()", and/or "Class::C3::uninitialize()" at the appropriate times as documented in the Class::C3 docs. These three functions are always provided by MRO::Compat, either via Class::C3 itself on older Perls, or directly as no-ops on 5.9.5+. SEE ALSO
Class::C3 mro AUTHOR
Brandon L. Black, <blblack@gmail.com> COPYRIGHT AND LICENSE
Copyright 2007-2008 Brandon L. Black <blblack@gmail.com> This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.18.2 2012-12-04 MRO::Compat(3)
All times are GMT -4. The time now is 02:04 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy