05-28-2009
use NR==1, then a for loop using NF as counter, loop through the fields one by one, checking for "beta". Get the value of the field number to a variable. After that print that value for every line.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Can we replace the contents the of the rows of file, from one position to another position by mentioning, some start position & the width? (4 Replies)
Discussion started by: videsh77
4 Replies
2. Shell Programming and Scripting
In a shell script, how I can achieve substitution of shell script var to a regular
expression, as shown below.
var=`head -1 file1`
awk '$0!~/$var/ {print $0}' file1 > file2
In the case above $var value literally considered for non-exists criteria. (3 Replies)
Discussion started by: videsh77
3 Replies
3. UNIX for Dummies Questions & Answers
Hello!
I've got txt-file containing lots of data in sentences like this:
;;BA;00:00:03:00;COM;CLOQUET-LAFOLLYE;SIMON;
but sometime more than on in a line like this:
;;BA;00:00:03:00;COM;CLOQUET-LAFOLLYE;SIMON;;;BA;00:00:03:00;REA;RTL9;;;;BAC;:00;TIT;SEMAINE SPECIALE ~SSLOGAN~T DVD;;
... (3 Replies)
Discussion started by: maco_home
3 Replies
4. Shell Programming and Scripting
Hi there!
I'm trying to validate a simple 6 digits number with reg expr. I ONLY want 6 digits so when i type 7 digits the script should no validate the number.
I've write this code:
#!/usr/bin/perl
while(<STDIN>){
if($_=~/\d{6}/){
print "Bingo!\n";
... (2 Replies)
Discussion started by: BufferExploder
2 Replies
5. Shell Programming and Scripting
Hello,
I am new in perl and in regular exprecion; so I am looking for help (or an experienced advise.)
The target is a triming spaces from a string: i.e., remove spases from begining and from end of a string.
One of main point of a searched solution is performance: for current task it is... (2 Replies)
Discussion started by: alex_5161
2 Replies
6. Shell Programming and Scripting
Hi All,
I am in need of help. I want to match a value of each row in “file 1” with the value of first row in “file 2” and print out only the columns that match. How can I do it in awk? Any help is greatly appreciated.
for example, I have two files:
Cat “File 1”
ID
3
8
15
Cat “File... (2 Replies)
Discussion started by: newpro
2 Replies
7. Programming
Hi All,
I need your input on how to mask out / ignore a string that does not match a working regular expression (continually refining) pattern in Java. Below is the code snippet which is picking up all the lines with the correct regular expression string except one known so far:
public... (0 Replies)
Discussion started by: gjackson123
0 Replies
8. Shell Programming and Scripting
Hello all, please help. There are two file like this:
file1:
1197510.0 294777.7 9666973.0 21.6 1839.8
1197510.0 294777.7 9666973.0 413.2 2075.9
1197510.0 294777.7 9666973.0 689.3 2260.0
... (1 Reply)
Discussion started by: attila
1 Replies
9. Shell Programming and Scripting
Hi,
I have a file filled with search strings which have a blank in between and look like this:
S. g. Ehr.
o. Jg.
v. d. Chijs
g. Ehr.
Now i would like to search for the strings and it also shall return the next column after the match.
awk -v FILE="search_strings.txt" 'BEGIN {... (10 Replies)
Discussion started by: sdf
10 Replies
10. Shell Programming and Scripting
Hi,
My input files is like this
axis1 0 1 10
axis2 0 1 5
axis1 1 2 -4
axis2 2 3 -3
axis1 3 4 5
axis2 3 4 -1
axis1 4 5 -6
axis2 4 5 1
Now, these are my following tasks
1. Print a first column for every two rows that has the same value followed by a string.
2. Match on the... (3 Replies)
Discussion started by: jacobs.smith
3 Replies
ZSPMV(l) ) ZSPMV(l)
NAME
ZSPMV - perform the matrix-vector operation y := alpha*A*x + beta*y,
SYNOPSIS
SUBROUTINE ZSPMV( UPLO, N, ALPHA, AP, X, INCX, BETA, Y, INCY )
CHARACTER UPLO
INTEGER INCX, INCY, N
COMPLEX*16 ALPHA, BETA
COMPLEX*16 AP( * ), X( * ), Y( * )
PURPOSE
ZSPMV performs the matrix-vector operation y := alpha*A*x + beta*y, where alpha and beta are scalars, x and y are n element vectors and A
is an n by n symmetric matrix, supplied in packed form.
ARGUMENTS
UPLO - CHARACTER*1
On entry, UPLO specifies whether the upper or lower triangular part of the matrix A is supplied in the packed array AP as follows:
UPLO = 'U' or 'u' The upper triangular part of A is supplied in AP.
UPLO = 'L' or 'l' The lower triangular part of A is supplied in AP.
Unchanged on exit.
N - INTEGER
On entry, N specifies the order of the matrix A. N must be at least zero. Unchanged on exit.
ALPHA - COMPLEX*16
On entry, ALPHA specifies the scalar alpha. Unchanged on exit.
AP - COMPLEX*16 array, dimension at least
( ( N*( N + 1 ) )/2 ). Before entry, with UPLO = 'U' or 'u', the array AP must contain the upper triangular part of the symmetric
matrix packed sequentially, column by column, so that AP( 1 ) contains a( 1, 1 ), AP( 2 ) and AP( 3 ) contain a( 1, 2 ) and a( 2, 2
) respectively, and so on. Before entry, with UPLO = 'L' or 'l', the array AP must contain the lower triangular part of the symmet-
ric matrix packed sequentially, column by column, so that AP( 1 ) contains a( 1, 1 ), AP( 2 ) and AP( 3 ) contain a( 2, 1 ) and a(
3, 1 ) respectively, and so on. Unchanged on exit.
X - COMPLEX*16 array, dimension at least
( 1 + ( N - 1 )*abs( INCX ) ). Before entry, the incremented array X must contain the N- element vector x. Unchanged on exit.
INCX - INTEGER
On entry, INCX specifies the increment for the elements of X. INCX must not be zero. Unchanged on exit.
BETA - COMPLEX*16
On entry, BETA specifies the scalar beta. When BETA is supplied as zero then Y need not be set on input. Unchanged on exit.
Y - COMPLEX*16 array, dimension at least
( 1 + ( N - 1 )*abs( INCY ) ). Before entry, the incremented array Y must contain the n element vector y. On exit, Y is overwritten
by the updated vector y.
INCY - INTEGER
On entry, INCY specifies the increment for the elements of Y. INCY must not be zero. Unchanged on exit.
LAPACK version 3.0 15 June 2000 ZSPMV(l)