09-17-2006
ideas for perl script - strings,conditionals..etc
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 $AA[0][$j] , $AA[1][$j] , $AA[2][$j] .. is the row and column ... like this ..
for($j=0;$j<$len;$j++){
if($AA[0][$j] eq "what goes here??" && $AA[1][$j] eq "A" && $AA[2][$j] eq "A"){
print "blah blah \n";
exit;}
else{}
}
what I would like to do is put it in 2 for loops like this...
for($i=0;$i<3;$i++){
for($j=0;$j<$len;$j++){
if($AA[$i][$j] eq one of the characters S,H,A,R,A,T..what I do here??? ){
print "blah blah \n";
exit;}
else{}
}
}
Tips ideas and code are welcome.
10 More Discussions You Might Find Interesting
1. 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
2. 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
3. Shell Programming and Scripting
Hi, I'm trying to write a script to search through my computer and
find all .jpg files and put them all in a directory. So far I have
this:
for i in `find /home -name '*.jpg' ` ; do mv $i home/allen/Pictures/PicturesFound ; done
When I run it, I get this error (this is only part of it, it... (2 Replies)
Discussion started by: FortressPTH
2 Replies
4. Shell Programming and Scripting
I have file that looks like:
ATOM 2517 O VAL 160 8.337 12.679 -2.487
ATOM 2518 OXT VAL 160 7.646 12.461 -0.386
TER
ATOM 2519 N VAL 161 -14.431 5.789 -25.371
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 ... (4 Replies)
Discussion started by: kanikasharma
4 Replies
5. 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
6. Shell Programming and Scripting
Hi Gurus,
I need a simple logic idea what can be done in the below shell script.
I written a script to do a automated maintenance work on every month of 15th and I have scheduled it through the crontab. I need to send an alert email to the user before 24 hrs of that maintenance script run.... (5 Replies)
Discussion started by: ramkumar15
5 Replies
7. 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
8. Shell Programming and Scripting
Heyas
If you recall, not too long ago, i was asking about the GNU Autotools. The feedback on that was almost unisense, and me figured that it turned my (back then) +98% SHELL project into a +73% GROFF project... :(
Felt a bit overhelmed, specialy since i didnt actualy use or need the true... (0 Replies)
Discussion started by: sea
0 Replies
9. Shell Programming and Scripting
Hello, pro scripters, noob here,
I am complete noob in this and I have to write a program which:
Calculates the modulus of two numbers which the user enters with keyboard. Number interval 1-9. These two numbers that were entered and modulus which was calculated are stored in a separate file.... (1 Reply)
Discussion started by: IrmantasID
1 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 DEBIAN
zgeqrt2.f
zgeqrt2.f(3) LAPACK zgeqrt2.f(3)
NAME
zgeqrt2.f -
SYNOPSIS
Functions/Subroutines
subroutine zgeqrt2 (M, N, A, LDA, T, LDT, INFO)
ZGEQRT2
Function/Subroutine Documentation
subroutine zgeqrt2 (integerM, integerN, complex*16, dimension( lda, * )A, integerLDA, complex*16, dimension( ldt, * )T, integerLDT,
integerINFO)
ZGEQRT2
Purpose:
ZGEQRT2 computes a QR factorization of a complex M-by-N matrix A,
using the compact WY representation of Q.
Parameters:
M
M is INTEGER
The number of rows of the matrix A. M >= N.
N
N is INTEGER
The number of columns of the matrix A. N >= 0.
A
A is COMPLEX*16 array, dimension (LDA,N)
On entry, the complex M-by-N matrix A. On exit, the elements on and
above the diagonal contain the N-by-N upper triangular matrix R; the
elements below the diagonal are the columns of V. See below for
further details.
LDA
LDA is INTEGER
The leading dimension of the array A. LDA >= max(1,M).
T
T is COMPLEX*16 array, dimension (LDT,N)
The N-by-N upper triangular factor of the block reflector.
The elements on and above the diagonal contain the block
reflector T; the elements below the diagonal are not used.
See below for further details.
LDT
LDT is INTEGER
The leading dimension of the array T. LDT >= max(1,N).
INFO
INFO is INTEGER
= 0: successful exit
< 0: if INFO = -i, the i-th argument had an illegal value
Author:
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date:
November 2011
Further Details:
The matrix V stores the elementary reflectors H(i) in the i-th column
below the diagonal. For example, if M=5 and N=3, the matrix V is
V = ( 1 )
( v1 1 )
( v1 v2 1 )
( v1 v2 v3 )
( v1 v2 v3 )
where the vi's represent the vectors which define H(i), which are returned
in the matrix A. The 1's along the diagonal of V are not stored in A. The
block reflector H is then given by
H = I - V * T * V**H
where V**H is the conjugate transpose of V.
Definition at line 128 of file zgeqrt2.f.
Author
Generated automatically by Doxygen for LAPACK from the source code.
Version 3.4.1 Sun May 26 2013 zgeqrt2.f(3)