Hello,
I need help in the following problem: I have this datarow
0 23 43 67 123 345 565 342 100 42 12 1 0 0 23 43 67 123 345 565 342 100 42 12 1 0
I want to filter out those columns, which are out of the mean vaule +/- standard deviation of the positions of the numbers. Position means the...
Ok, thanks.
Just one more thing: could you suggest something to do this in a reverse mode, i.e. if I have only
0 1 0 0 1 0 1 1 1 0 1 0 1
rows, how could I convert these to one just contatining the positions of the "1"-s ?
(Probably it is not so easy when the number of columns might varied...)
Hello,
I have the following output from some program:
10 3 7 9 10
the first column is: there should be 10 colums
the other columns are the position of some arbitrary character, let's say "1". I need to convert the row above to this line
0 0 1 0 0 0 1 0 1 1
Could anyone help me?
No. You just take into account the $2 and $5 columns as indecies of the 2d array, let's say a[$2,$5]; and you should add $3 and $6 together +=$3 + +=$6 somehow ....
Sorry, just a remark: $1==$4 in the sense, that their values are the same; they should not necessery be in the same row, as you might see for example in the beginning
1 4 8 1 3 9 <----- here $1 == $4
1 1 9 2 1 24 <----- here $1 != $4
but we have have to take into account that...
This part is not so trivial for me:
awk '{a[$1,$2]+=$3;a[$4,$5]+=$6;}END{for(i=1;i<=NR;i++)for(i=1;j<=4;j++)print i,j,a[i,j];}'
So far this is not working properly. Importent point is that the numbers in the 1st and 4th columns goes from 1 to arbitrary value, let's sat from 1 to 10000; only...
Hi all,
I have a problem, and cannot see how to solve it, so I need some help.
I have a data file like this:
1 4 8 1 3 9
1 1 9 2 1 24
2 4 14 2 2 54
2 3 4 2 4 39
2 1 2 2 1 103
4 2 4 3 2 78
4 4 9 3 1 1
I would like to make a 2d histogram from this data in the following way:
- the...
Nice, thanks. Can you split this line
_ _ _ _ 12 _ _ 234 1 7 _ _ 99 _ 9 _
into the following:
_ _ _ _
12 _ _ 234
1 7 _ _
99 _ 9 _
For example I have 16 columns in a row, and I would like to start a new line after every 4th columns.
I did it in this way but not helped so far:
awk...
Hi,
I am just wondering how can be solved the following problem:
I have the numbers
0 0 0 0 12 0 0 234 1 7 0 0 99 0 9 0 0
Now I would like to convert this to
_ _ _ _ 12 _ _ 234 1 7 _ _ 99 _ 9 _ _
I think I should use a[0]="_"; ...etc. but if I have numbers different from 0's it is a...
Sorry, my last question makes no sense. It is trivial.
But what i would like to ask if there is
1 6 8
1 1 9
2 6 14
2 1 14
4 6 5
How can I get this
6 8
1 1 9
2 6 14
2 1 14
3 0 0
4 6 5
or rather
1 9 0 0 0 0 8 0 0 0 0 0 0 0 0 0 0
2 14 0 0 0 0 14 0 0 0 0 0 0 0 0 0 0
3 0 0 0 0 0 0 0 0 0 0 0 0...
Hi,
that's nice. Just one more simple question: how can I modify the code if I want to get
1 9 0 0 0 0 8 0 0 0 0 0 0 0 0 0 0
instead of
1 9 0 0 0 0 8
So the number of columns should be 16 in any cases; and for example the second column of
1 6 8
1 1 9
2 6 14
2 1 14
4 6 5
just indicating...
Hi all,
Can anyone help me to convert the following, which actually what I would like to get from the previous lines:
I have the file
1 6 8
1 1 9
2 6 14
2 1 14
4 6 5
I would like to get
1 9 0 0 0 0 8
2 14 0 0 0 0 14
4 0 0 0 0 0 5
So the first column is just a row number, the 2nd is the...
This seems to be ok, but this is the result, as you know
dd dd
cd cd
cc cc
dd dd
cd cd
cc cc
This output is duplicated somehow, instead of this I would like to get
dd dd
cd cd
cc cc
Thanks!
Hello,
I have the following simple code (see below), which makes from this input file,where [\tab] means that there is tab instead of space:
1 1 0 1 0 0 [\tab] 1 1 0 1 0 0
this output
dd
cd
cc
dd
cd
cc
Now, this is good, but i would like to get rather output like this
dd [\tab] dd
cd...
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.