Search Results

Search: Posts Made By: chrisjorg
999
Posted By chrisjorg
awk to select 2D data bins
I wish to use AWK to do something akin: Select all 2D data with 1<$1<2 and -7.5<$2<-6.5

But it's not working

awk 'END {print ($1<=2&&$1>=1&&$2<=-6.5&&$2>=-7.5)}' bla


Data:

-1.06897...
1,347
Posted By chrisjorg
awk Sort 2d histogram output from min(X,Y) to max(X,Y)
I've got Gnuplot-format 2D histogram data output which looks as follows.
6.5 -1.25 10.2804
6.5404 -1.25 10.4907
6.58081 -1.25 10.8087
6.62121 -1.25 10.4686
6.66162 -1.25 10.506
6.70202 -1.25...
746
Posted By chrisjorg
Variable in awk substituion
I have a file with 20 blank spaces.

I want to substitute each blank space for a string, and part of that string should include an incremental number [0 for first substitution, 19 for last]

...
3,051
Posted By chrisjorg
set a=`grep ENDMDL my_docking.pdb | wc -l` ...
set a=`grep ENDMDL my_docking.pdb | wc -l`
set b=`expr $a - 2`
csplit -k -s -n 3 -f my_docking. mydocking.pdb '/^ENDMDL/+1' '{'$b'}'
foreach f ( mydocking.[0-9][0-9][0-9] )
mv...
3,051
Posted By chrisjorg
Bash syntax error
while read line
do
mkdir $line
scp -r Docking_results/docking_$line.pdb $line/
cd /$line/
set a=`grep ENDMDL docking_'$line'.pdb | wc -l`
set b=`expr $a - 2`
csplit -k...
2,379
Posted By chrisjorg
First line in file "file" is PA2_2_f1010 so it is...
First line in file "file" is PA2_2_f1010 so it is echoing correctly.


What VMD wants is the value of a variable $line which contains the first line of the file "file", namely PA2_2_f1010..

but...
2,379
Posted By chrisjorg
Bash while read line
I have a script batch_vmdgenpqr.sh which has a problem:



#!/bin/bash
while read line
do
vmd.sh -dispdev text -e vmdgenpqr.tcl -args $line
done<file



The do line calls another...
5,576
Posted By chrisjorg
awk or Bash: Cumulative average
For the data



I would like to parse down and for each parsing
I want a cumulative averaging, stored in an array
that can be output.


I.e.
546/NR = 546

(546+344)/NR=(546+344)/2 =...
4,631
Posted By chrisjorg
I want on the first parsing, to parse until...
I want on the first parsing, to parse until $2<cutoff,

At this point, I want to exit. I want to print NR, and $2.

Not all data files I input will meet the $2<cutoff, hence I set the variable...
4,631
Posted By chrisjorg
If anyone could help I would be very grateful.
If anyone could help I would be very grateful.
4,631
Posted By chrisjorg
awk '(FILENUM != ARGIND) { ...
awk '(FILENUM != ARGIND) {
FILENUM=ARGIND; arr[FNR]=$1; arr2[FNR]=$2}
(ARGIND == 1) {
if($2<4.5) {
complete="YES"
exit}
...
4,631
Posted By chrisjorg
Hello, yes it's the same data, the data...
Hello,


yes it's the same data,
the data has an exponential-type decay, to a plateau value.

I wish to start analysing the data once it crosses a cutoff value ($2<cutoff).

But I've had...
4,631
Posted By chrisjorg
OK thanks will try, I thought maybe the...
OK thanks will try,

I thought maybe the easiest solution would be to split up the file into 2 separate files at

{$2=cutoff}

and then processing the second file would be simple?
4,631
Posted By chrisjorg
thanks, but I still have some questions ...
thanks, but I still have some questions


awk '(FILENUM != ARGIND) {
if(FILENUM) {
# "end" section of the previous file, if any
# Process and print data...
4,631
Posted By chrisjorg
awk ' BEGIN {arr[NR]=$1;...
awk '
BEGIN {arr[NR]=$1; arr2[NR]=$2; arr3[NR]+=$2}
(arr2[NR-1]-$2)<threshold {n++}
{if(NR<299 && $2<cutoff) {complete="YES"} else {complete="NO"}}
...
4,631
Posted By chrisjorg
Yes, that works. What would be super, is if...
Yes, that works.

What would be super, is if I could extend the

&& ($2-arr2[NR-1])<threshold

condition so that say, 10 iterations have to hold true before it exits? I'm trying to probe my...
4,631
Posted By chrisjorg
Thanks, that works. I also want to work...
Thanks, that works.


I also want to work out the difference of every value value in the array relative to the first entry. I would like to print this into a file.

arr2[1]-arr2[i]


...
4,631
Posted By chrisjorg
I wish to use AWK to parse my data, AWK...
I wish to use AWK to parse my data,


AWK must read $1 into arr[i] and $2 into arr2[i]


I wish the parsing to stop when the value in arr2 is less than a constant cutoff value I pick.

At...
4,631
Posted By chrisjorg
Awk: Iterate over all records, stop when value < threshold
Hello I have data arranged in two columns

0 7.7272086460791485
1 7.560656885151559
2 7.019966124180658
3 7.2403229620576015
4 7.200882072174212
5 7.3231008505909445
6 7.284184600697482
7...
10,724
Posted By chrisjorg
2,081
Posted By chrisjorg
Setting locales
I'm having a problem with my locale setting.



Essentially, when using Xmgrace or Awk, all . are replaced with ,
leading to wrong arithmetic.



Here is an explanation of the problem:...
1,853
Posted By chrisjorg
#!/bin/bash for((i=1;i<=200;i++)) do ...
#!/bin/bash
for((i=1;i<=200;i++))
do
foo=`expr 0.018\*$i`
echo $foo >> bla
done


Gives

expr 0.018 \* $i
expr 0.018 \* $i
expr 0.018 \* $i
expr 0.018 \* $i
expr 0.018 \* $i
expr...
1,853
Posted By chrisjorg
for((i=1;i<=200;i++)) do echo '0.018*'$i >>...
for((i=1;i<=200;i++))
do
echo '0.018*'$i >> bla
done

with
ksh -x ./script

---------- Post updated at 06:54 AM ---------- Previous update was at 06:52 AM ----------

Ok, but now I get
...
1,853
Posted By chrisjorg
Korn shell if it's a bash script. Also,...
Korn shell if it's a bash script.

Also, your script doesn't work for me, I get

*0.018 0
*0.018 1
*0.018 2
*0.018 3
*0.018 4
*0.018 5
*0.018 6
*0.018 7
*0.018 8
*0.018 9
*0.018 10...
1,853
Posted By chrisjorg
AWK print initial record and double
I have an initial record 0.018

I would like a script that would for i=0;i<200;i++ print
0.018*1
0.018*2
0.018*3
0.018*4
...
0.018*200
using newline.
Showing results 1 to 25 of 89

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