Hi,
I have a file like this:
.....
10801 0.0 14.1 1.09083 0.00744552 0.00142242 0.0201911
10802 0.10 14.08 1.06125 0.00697322 0.00133229 0.0201911
10803....
$1 is an length coordinate, and I would like to create a depth coordinate as $2 so that i have a depth every 10 cm for 1 metre and...
this works but if anyone knows how to shrink it, i would be very happy.
rm -f data_out.txt
minmax -C data_in.txt | awk '{print "min="$1; print "max="$2}' > minmax.var
. minmax.var
for ((i = $min; i <= $max; i++))
do
awk '{if ($1 == "'$i'") print $0}' data_in.txt > temp.dat
awk '{
s += $7}...
I know this question has been put before, but in a more simplistic way, like averaging $1 every 5 rows.
I would like to know how to average out a column when $1 has the same number ( but there is not equal amounts of numbers in $1). e.g.
635 -1.47 0 62.125 8.835 7.365 5.5
635 -1.97 1.91877...
Hi, I have two files. E.g:
file a: 486 -1.47 38.1073
file b: 486 -1.97 34.7981 -3.35
and this is my script so far:
awk '
BEGIN {
while (getline < "file b") {
count[$1]=$2
}
}
{
if (count[$1])
print $1, $2*-1, $3, count[$1]*-1}' file a > out
I also want to...
ok brilliant, thanks. just out of interest (and an attempt to understand awk a bit better) though- the results come out in a peculiar order:
802 -12.97 0.456745 -14.43
885 -11.97 7.04983 -12.11
844 -12.97 1.49356 -13.805
570 -5.47 3.37087 -5.93
803 -12.97 0.27474 -14.36
886 -11.47 4.14797 -12.07...
the output from this comes out as:
780
740
781
741
700
782
742
701
which are unordered numbers from $1, it doesn't appear to print "i"
I'm looking for the output of, for example (sorry i realise i didn't actually state very well the desired output):
486 -2.97 2.89847 -3.35
487 -1.97...
Hi, is it possible find the maximum depth in $2 for every different value in $1(a coordinate)?. The depth in the file ranges to a maximum of around -14 and always starts at -1.47. $4 is "actual" depth
486 -1.47 1.83712 -3.35
486 -1.97 1.67761 -3.35
486 -2.47 1.4363 -3.35
486 -2.97 2.89847 -3.35...
I'm hoping this is a simple question:
my script:
x="B1"
if [ "$x" = B* ]; then
echo B
else
echo M
fi
this doesn't work but hopefully you can see what i want to do - how do i get the if loop to recognize that the input contains the letter 'b' with out having to do:
if [ x = 1 ] || [ x = 2 ]...
ok, i think i may have found a long winded way of doing this by producing a file of variables:
var1=12.38762
var2=12.3878
var3=12.38797
var4=12.38875
var5=12.38895
var6=12.38915
however i am having trouble feeding this variable into awk.
command check produces:
echo $var1
12.38762
echo $var2...
Hi, I am trying to smooth out some data. I have a long file formatted with position and signal strength:
22.38762 55.43485 107.333
22.3878 55.43485 94.0333
22.38797 55.43487 83.1333
22.38875 55.435 86.2666
22.38895 55.435 93.2999
I want to go through each line and find all other records in the...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.