Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: userand
  • Order by date
  1. userand

    Filter columns

    Could anyone help me a little? Just give some hits how to modify it... Thanks in advance!
  2. userand

    Filter columns

    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...
  3. userand

    Conversion

    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...)
  4. userand

    Conversion

    Yes, I have already tried it, but this case is a bit different, because I have only one row and just the positions of the "1"-s...
  5. userand

    Conversion

    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?
  6. userand

    2d arrays help

    Ok, well, let's start again. I have this data # 1st col 2nd col 3rd col 4th col 5th col 6th col 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 5 1 3 6 4 2 - The 1st and the 4th cols numbering go from 1 to let's say 1000, and...
  7. userand

    2d arrays help

    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 ....
  8. userand

    2d arrays help

    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...
  9. userand

    2d arrays help

    Hi, I did a mistake in my explanation. Correction: I have these data file: 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 5 1 3 6 4 2 And I should get this 1 1 105 1 2 56 1 3 18 1 4 46 2 1 0 2 2 0 2 3 0 2 4 0 3 1 28 3 2 58 3 3 0 3...
  10. userand

    2d arrays help

    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...
  11. userand

    2d arrays help

    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...
  12. userand

    Print out numbers on display

    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...
  13. userand

    Print out numbers on display

    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...
  14. userand

    Converting numbers

    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...
  15. userand

    Converting numbers

    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...
  16. userand

    Converting numbers

    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...
  17. userand

    Separate output

    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!
  18. userand

    Separate output

    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...
  19. userand

    count numbers column by column

    Sorry, a very last question: how would I count and set gsub(/1/,"",a) a by a ? I mean: if(a==1 && x>1) if(a==2 && x>3) ... Is it correct?
  20. userand

    count numbers column by column

    Thanks a lot! This is not so hard, but I am an idiot...

Part and Inventory Search

Back
Top