Search Results

Search: Posts Made By: chrisjorg
1,909
Posted By elixir_sinari
Which shell? Try: for((i=1;i<=200;i++)) do ...
Which shell? Try:
for((i=1;i<=200;i++))
do
echo '0.018*'$i
done
1,417
Posted By rdrtx1
Exponentiation.
Exponentiation.
2,757
Posted By delugeag
You forgot to add the numbers of the even lines....
You forgot to add the numbers of the even lines. The code sould be :
sum[i]/2 ==> (sum[i] + $i)/2
2,757
Posted By elixir_sinari
awk '{sum+=$1}!(NR%2){print...
awk '{sum+=$1}!(NR%2){print sum/2;sum=0}END{if(NR%2) print sum}' OFMT='%.10e' file
giving
2.0105894389e+02
4.9401600711e+01
4.6023262421e+01
-8.5584588497e+01
1.6223676923e+02
5.0666623459e+01...
2,247
Posted By Don Cragun
Unfortunately, the script above is functionally...
Unfortunately, the script above is functionally equivalent to:
END {print $2 > "junk" }
which only writes the 2nd field from the last line in your input file into a file named junk. But, I think...
2,247
Posted By Chubler_XL
Try this: awk -F" " '{ ...
Try this:

awk -F" " '{
bucket=int($1*10+68)
v[bucket]++
l[bucket,v[bucket]]=$0
f[bucket,v[bucket]]=$2
}
END {
for(i=1;i<=137;i++) {
loutput="file_"i
...
6,700
Posted By delugeag
for example : awk ' BEGIN {sum=0;summ=0} ...
for example :

awk '
BEGIN {sum=0;summ=0}
{
arr[NR]=$1
sum+=$1
}
END {
average=sum/NR

for (i=1;i<=NR;i++) {
summ+=(arr[i]-average)^2
}
print summ
}
' fileplease...
24,101
Posted By itkamaraj
awk '{print "pdb_"$0".namd"}'...
awk '{print "pdb_"$0".namd"}' input.txt
1,797
Posted By methyl
There are some very well educated people who post...
There are some very well educated people who post on this site. Personally I have never heard of this product. Please post what hardware, Operating System and relevant package software you are...
1,634
Posted By CarloM
[/tmp] awk '{nm=sqrt(($1*$1)+($2*$2)+($3*$3));...
[/tmp] awk '{nm=sqrt(($1*$1)+($2*$2)+($3*$3)); print $1/nm FS $2/nm FS $3/nm}' file
-0.273 -0.919946 -0.281371
-0.600509 -0.770732 -0.212982
-0.429911 -0.884231 0.182515
2,182
Posted By Scrutinizer
The value of $9 is missing in test.pdb. If I put...
The value of $9 is missing in test.pdb. If I put in -10.171, I get 55.1925 and I get 55.1925 and also on my calculator. Maybe you made a typo?
test2.db gives 77.9203 with awk and also on the...
1,922
Posted By Scott
Another awk one: awk '$1 != X && X = $1 {...
Another awk one:

awk '$1 != X && X = $1 { if(NR>1)print "" } 1' file
18,911
Posted By Corona688
Typo. awk 'BEGIN { MIN=99999999; MAX=-MIN;...
Typo.

awk 'BEGIN { MIN=99999999; MAX=-MIN; OFS="\t"; BINSIZE=10; }

{ A=sprintf("%d", $2/BINSIZE);
B=sprintf("%d", $3/BINSIZE);
BIN[A OFS B]++;
}
END { for(X in...
18,911
Posted By Corona688
There's a reason I set the MIN and MAX values to...
There's a reason I set the MIN and MAX values to what they were. Look at the defaults -- a positive minimum and a negative maximum. The first data item will override them because they're smaller...
Forum: Programming 01-21-2012
1,471
Posted By drl
Hi. Are you sure that you have unformatted...
Hi.

Are you sure that you have unformatted data? What do you think that means? ... cheers, drl
Forum: Programming 01-26-2012
1,841
Posted By dhzdh
Looking at the program, it appeared to me that...
Looking at the program, it appeared to me that atoms1 is a list. len(atoms1) is the number of items in the list. From skimming the program it appears to me that it is possible under certain...
13,650
Posted By Corona688
If you could post a sample of your data, a sample...
If you could post a sample of your data, a sample of what output you want, and show your calculations that would be much, much better than trying to explain an algorithm in casual English. It's a...
13,650
Posted By Corona688
Given that awk script doesn't even have 7 lines,...
Given that awk script doesn't even have 7 lines, I'm not sure what to tell you about the syntax error, but if you want a standard deviation for each column, you're going to need to loop over each...
Showing results 1 to 18 of 18

 
All times are GMT -4. The time now is 05:00 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy