10-20-2011
@Skrynesaver, i used the code. It removes only TER and not line before it (ATOM 2518 OXT VAL 160 7.646 12.461 -0.386) and not even3 lines after the immediate line after TER i.e
(ATOM 2520 H1 VAL 161 -15.336 5.698 -25.811
ATOM 2521 H2 VAL 161 -13.416 10.529 17.708
ATOM 2522 H3 VAL 161 -14.363 9.436 18.498)
Ihave attatched a file.
---------- Post updated at 10:52 PM ---------- Previous update was at 10:43 PM ----------
---------- Post updated at 11:15 PM ---------- Previous update was at 10:52 PM ----------
@durden_tyler
if i run this on all 200 files,what change has to be made?since there are 200 files for 1 system and there are 120 systems
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
In perl I want to do remove the top line of my input file then process the next line. I want to do something like
head -1 inputfile > temp
grep -v temp inputfile > newinputfile
cp newinputfile inputfle
is this possible in perl? (3 Replies)
Discussion started by: reggiej
3 Replies
2. Shell Programming and Scripting
I have a matrix , how do I compare all the elements of a column , lets say I want to check if the columns contain the alphabets "S","H","A","R","A","T".
and not "X"s.
Lets say matrix looks something like this ..
SSSXSH
HHXXHA
AAXXAT
RRRXRS
AAXTAR
TTTTTA
I can hard code it where... (4 Replies)
Discussion started by: sharatz83
4 Replies
3. UNIX for Dummies Questions & Answers
Hello,
I have a file that lists a few hundred values.
Example:
abca
abcb
abcc
abcd
I have a 2nd file with a few thousand lines. I need to remove every line from the 2nd file that contains any of the values listed in first file.
Example of strings to delete:
line1 *abca* end of... (1 Reply)
Discussion started by: upstate_boy
1 Replies
4. Shell Programming and Scripting
Hi Folks,
The subject is my question:
Can we pass an array of strings from a Perl Program to a Shell Script?
Please provide some sample code.
Thanks
---------- Post updated at 11:52 PM ---------- Previous update was at 11:43 PM ----------
I got it.
Its here:... (0 Replies)
Discussion started by: som.nitk
0 Replies
5. Shell Programming and Scripting
Dear all,
I have a variable called $abc, which the value is something like below,
*** *********** : *****
where * can be anything. I need to remove all but the final characters until last whitespace.
example
grd groupstudy : tutor6/7
becomes tutor6/7
something like
if... (2 Replies)
Discussion started by: tententen
2 Replies
6. Shell Programming and Scripting
HI all,
These are examples of the original value from a variable
$abc can be
FastEthernet1/0
GigabitEthernet3/1
Serial1/0
If $abc is FastEthernet*/* (where * can be any number), replace $abc value to fa*/* (same number as the original value). GigabitEthernet becomes ga*/* and Serial... (2 Replies)
Discussion started by: tententen
2 Replies
7. Shell Programming and Scripting
Hello,
I have a huge file of over 2,00,00,00 strings in UTF8 format. I have managed to write a script in Perl which sorts them neatly as per their Unicode ranges.
However I am now stuck with a script which will pipe out all strings between 3 and 20 letters/characters. I am not very good at... (2 Replies)
Discussion started by: gimley
2 Replies
8. Shell Programming and Scripting
Hi folks,
I have a log file in the below format and trying to get the output of the unique ones based on mnemonic IN PERL.
Could any one please let me know with the code and the logic ?
Severity Mnemonic Log Message
7 CLI_SCHEDULER Logfile for scheduled CLI... (3 Replies)
Discussion started by: scriptscript
3 Replies
9. Programming
Perl script to merge cells
---------- Post updated at 12:59 AM ---------- Previous update was at 12:54 AM ----------
I am using below code to read files from a dir and print to excel.
open(my $in, '<', $file) or die "Could not open file: $!";
my $rowCount = 0;
my $colCount = 0;... (11 Replies)
Discussion started by: Jack_Bruce
11 Replies
10. Shell Programming and Scripting
Hi team,
I'm a newbie of Perl Script and looking to create a simple perl script that will run in the Linux system:
1) to find process, such as ps -ef | grep process name
2) to exclude strings from the output if it found, for instance if i see abc from usr process, then will exclude it from... (1 Reply)
Discussion started by: hoffman2503
1 Replies
LEARN ABOUT REDHAT
universal
UNIVERSAL(3pm) Perl Programmers Reference Guide UNIVERSAL(3pm)
NAME
UNIVERSAL - base class for ALL classes (blessed references)
SYNOPSIS
$is_io = $fd->isa("IO::Handle");
$is_io = Class->isa("IO::Handle");
$sub = $obj->can("print");
$sub = Class->can("print");
use UNIVERSAL qw( isa can VERSION );
$yes = isa $ref, "HASH" ;
$sub = can $ref, "fandango" ;
$ver = VERSION $obj ;
DESCRIPTION
"UNIVERSAL" is the base class which all bless references will inherit from, see perlobj.
"UNIVERSAL" provides the following methods and functions:
$obj->isa( TYPE ), CLASS->isa( TYPE ), isa( VAL, TYPE )
C<TYPE> is a package name
$obj is a blessed reference or a string containing a package name
C<CLASS> is a package name
C<VAL> is any of the above or an unblessed reference
When used as an instance or class method ("$obj-"isa( TYPE )>), "isa" returns true if $obj is blessed into package "TYPE" or inherits
from package "TYPE".
When used as a class method ("CLASS-"isa( TYPE )>; sometimes referred to as a static method), "isa" returns true if "CLASS" inherits
from (or is itself) the name of the package "TYPE" or inherits from package "TYPE".
When used as a function, like
use UNIVERSAL qw( isa ) ;
$yes = isa $h, "HASH";
$yes = isa "Foo", "Bar";
or
require UNIVERSAL ;
$yes = UNIVERSAL::isa $a, "ARRAY";
, "isa" returns true in the same cases as above and also if "VAL" is an unblessed reference to a perl variable of type "TYPE", such as
"HASH", "ARRAY", or "Regexp".
$obj->can( METHOD ), CLASS->can( METHOD ), can( VAL, METHOD )
"can" checks if the object or class has a method called "METHOD". If it does then a reference to the sub is returned. If it does not
then undef is returned. This includes methods inherited or imported by $obj, "CLASS", or "VAL".
"can" cannot know whether an object will be able to provide a method through AUTOLOAD, so a return value of undef does not necessarily
mean the object will not be able to handle the method call. To get around this some module authors use a forward declaration (see perl-
sub) for methods they will handle via AUTOLOAD. For such 'dummy' subs, "can" will still return a code reference, which, when called,
will fall through to the AUTOLOAD. If no suitable AUTOLOAD is provided, calling the coderef will cause an error.
"can" can be called as a class (static) method, an object method, or a function.
When used as a function, if "VAL" is a blessed reference or package name which has a method called "METHOD", "can" returns a reference
to the subroutine. If "VAL" is not a blessed reference, or if it does not have a method "METHOD", undef is returned.
VERSION ( [ REQUIRE ] )
"VERSION" will return the value of the variable $VERSION in the package the object is blessed into. If "REQUIRE" is given then it will
do a comparison and die if the package version is not greater than or equal to "REQUIRE".
"VERSION" can be called as either a class (static) method, an object method or or a function.
These subroutines should not be imported via "use UNIVERSAL qw(...)". If you want simple local access to them you can do
*isa = &UNIVERSAL::isa;
to import isa into your package.
perl v5.8.0 2002-06-01 UNIVERSAL(3pm)