The most universal solution would be to use a case statement, for example:
Additionally, in bash you could also use:
or in recent bash:
Note the double square brackets
Last edited by Scrutinizer; 03-01-2013 at 07:49 AM..
i need help with an awk question. i am looking to have an external variable be defined outside of awk but used in awk. so if we have fields $1, $2, $3 so on and so forth, i would like to be able to dictate what field is being printed by something like $. so if i had a counter called test, make it 3... (8 Replies)
So I have a if statement inside an awk to check if $2 of a awk equals a specific IP but the test fails. So here is what I have.
# !/bin/sh
echo "Enter client ID"
read ID
echo "Enter month (01, 02, 03)"
read month
echo "Enter day (03, 15)"
read day
echo "Enter Year (07, 08)"
read... (6 Replies)
Dear all,
¿How can i insert a variable in a AWK pattern?
I have almost succeeded in solving a puzzle with AWK but now i want to make a script. Let me explain.
cat file.txt | awk 'BEGIN {RS="\\n\\n"} /tux/ { print "\n"$0 }'
I know that this command makes right what i want to do, but mi... (8 Replies)
Hello,
I am running a bash script under linux which first defines an CA-array like
j=0
num1=120.00
num2=10.00
until
do
CA='echo $num1 + $j*$num2'
j=$
done
within the later awk section of this same script I want to read data from a file. If the value of the second column is... (3 Replies)
I want to incorporate the variable in the for statement as a column of my processed file. In the INCORRECT example below, it is $i which corresponds to the i in my for loop:
for i in x86_64 i686; do
awk '{ print $1" "$4" "$5" "$i }'awk $file-$i > processed-$i.log
doneThanks! (3 Replies)
I'm trying to get the universities result data into different file, where the $9 contains unversity field and field7,4 & 5 contains the keys to sort the students by marks. How to use uni variable to match against $9 inside awk?
c=0
for uni in `cat /tmp/global_rank| awk -F ',' '{print... (1 Reply)
Hi,
How can I modify the FILETYPE command ?
I want to provide the file extension, like txt, root .?
Thanks,
#!/bin/bash
FROM=$1
TO=$2
FILETYPE=$3
... (4 Replies)
Hi All,
I am new to AWK programming. I have the following for loop in my awk program.
cat printhtml.awk:
BEGIN
-------- <some code here>
END{
----------<some code here>
for(N=0; N<H; N++)
{
for(M=5; M<D; M++) print "\t" D "";
}
-----
}
... (2 Replies)
So, I've been playing with speeding up some analysis we do by using multiple threads of awk (actually, mawk, but code-compatible as far as I use it) on multiple CPU cores. So, I have a big data file and I have several copies of exactly the same processor script, written in mawk. I also have a... (8 Replies)
Discussion started by: treesloth
8 Replies
LEARN ABOUT DEBIAN
nifti_stats
NIFTI_STATS(1) User Commands NIFTI_STATS(1)NAME
nifti_stats - compute NIfTI statistical functions
SYNOPSIS
nifti_stats [-q|-d|-1|-z] value CODE [p1 p2 p3]
DESCRIPTION
nifti_stats supports several distributions (normal, uniform, logistic, chi, etc.) and calculates density or cummulative distribution func-
tion (and many more). Values are printed to stdout and can be piped to other tools.
value can be a single number or in the form bot:top:step.
default ==> output p = Prob(statistic < val).
-q ==> output is 1-p.
-d ==> output is density.
-1 ==> output is x such that Prob(statistic < x) = val.
-z ==> output is z such that Normal cdf(z) = p(val).
-h ==> output is z such that 1/2-Normal cdf(z) = p(val).
Allowable CODEs:
CORREL, TTEST, FTEST, ZSCORE, CHISQ, BETA, BINOM, GAMMA, POISSON, NORMAL, FTEST_NONC, CHISQ_NONC, LOGISTIC, LAPLACE, UNIFORM, TTEST_NONC,
WEIBULL, CHI, INVGAUSS, EXTVAL, PVAL, LOGPVAL and LOG10PVAL
Following CODE are distributional parameters, as needed.
Results are written to stdout, 1 number per output line.
EXAMPLE
Piping output into AFNI program 1dplot:
nifti_stats -d 0:4:.001 INVGAUSS 1 3 | 1dplot -dx 0.001 -stdin
SEE ALSO libnifti(1), nifti_tool(1), nifti1_test(1).
Homepage: http://niftilib.sourceforge.net
AUTHOR
RW Cox - SSCC/NIMH/NIH/DHHS/USA/EARTH - March 2004
This manual page was written by Michael Hanke <michael.hanke@gmail.com>, for the Debian project (but may be used by others).
nifti_stats September 2007 NIFTI_STATS(1)