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 strongm 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: *

  1. tonivm

    conditional average

    Thanks. But how is it possible when appear a -9999 set for example 5 times the average should be 0. Thanks again
  2. tonivm

    conditional average

    Hi everybody: I have files where some values are -9999, and I would like to average some columns each five values but when the value is -9999 will skipped. I tried this: awk '{if ($5==-9999) skip; {s+=$5;++c}};{avg=s/5};{if(c==5){print $1, $2, $3, avg ; c=0; s=0}}' $fitxer.tmp2 > $fitxer.cl31...
  3. tonivm

    how manipulate the data with specif format

    Hi everybody: I have a problem with the format of a file. This file is like: 249. 0.30727021E+05 0.30601627E+05 0.37470780E-01 -0.44745335E+02 0.82674536E+03 248. 0.30428182E+05 0.30302787E+05 0.40564921E-01 -0.45210293E+02 0.81456091E+03 247...
  4. tonivm

    Compare two files

    Well: I have these two files file 1 20030601 14 05 498.985 0.436532 20030601 14 10 499.531 0.260819 20030601 14 15 499.427 0.508597 20030601 14 20 500.418 0.606761 20030601 14 25 496.877 0.233742 20030601 14 30 496.578 0.117021 20030601 14 35 497.189 0.487961 20030601 14 40 499.676 0.613496...
  5. tonivm

    Compare two files

    hi: I tried two options but both did not work correctly. First I tried this: join -j 1 -j 2 -j 3 -o 1.1,1.2,1.3,1.4,2.9 a.txt b.txt > final.txt but I have an error message which said that fields 1 and 2 are not compatibles. And on the other hand I tried this awk script: awk '{ if(NR==FNR)...
  6. tonivm

    Compare two files

    hi: how can I do exactly?. If file1 is: 20030601 14 05 498.985 0.436532 20030601 14 10 499.531 0.260819 20030601 14 15 499.427 0.508597 20030601 14 20 500.418 0.606761 20030601 14 25 496.877 0.233742 20030601 14 30 496.578 0.117021 20030601 14 35 497.189 0.487961 20030601 14 40 499.676...
  7. tonivm

    Compare two files

    Hi everybody: I have this new problem. I have two files which each one are separated with tabulations. The first have 5 columns where first is date, second hour and third is minute. In the other one, there are 13 columns and the three firsts columns are like the other one. My question is, how...
  8. tonivm

    integration with trapezoidal rule

    Hi everybody: Somebody know or have a simple script which can calculate the integration from a database using the trapezoidal rule. I have a file like: 0.490 952.296 284.19 11.3169 0.002481 0.488 0.01 0.500 965.57 288.25 11.3395 2.48E-03 0.048 0.01 0.510 964.47 288.25 10.8759 0.002479 0.036...
  9. tonivm

    paste files in one

    Thanks for your reply. But I tried to do like you said, but paste do not "paste" the file in order. And I would like that when paste it do it like this: paste file1 file2 file3 file10 file14 .... so on. :D
  10. tonivm

    paste files in one

    Hi everybody: Could anybody tell me how if I have several files ( each file it has one column) which each one it has this pattern name: name1.dat name2.dat name3.dat name4.dat name10.dat name11.dat name30.dat If I would like create one like: name_total.dat in order I have done this two...
  11. tonivm

    print selected lines

    Thakns a lot for replies. I have solved the problem. At the begining of the script, I have changed: #!/bin/sh for #!/bin/bash And now, it works correctly. Best regards for everybody.
  12. tonivm

    print selected lines

    Hi: Thanks for your reply. # You use bash, right ? ---- Yes I do. # Will not work in ksh. lines=( "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "21" "31" "41" "51" "55" "57" "58" ) # Why this line ? Remove it. # I did it now. # ${lines[@]} # Use distinct identifiers. This is not Perl. # Of...
  13. tonivm

    print selected lines

    Hi everybody: Hi everybody: I try to print in new file selected lines from another file wich depends on the first column. I have done a script like this: lines=( "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "21" "31" "41" "51" "55" "57" "58" ) ${lines[@]} for lines in ${lines[@]} do awk...
  14. tonivm

    smart program!!

    Thanks a lot. Cheers. :D
  15. tonivm

    smart program!!

    Hi everybody: I have awk script which calcule the total sum of each column like this: awk 'BEGIN{OFS=" };{s2+=$2;s3+=$3;s4+=$4;s5+=$5;s6+=$6;s7+=$7;s8+=$8;s9+=$9; s10+=$10;s11+=$11;s12+=$12}; END{print s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12}' file1 > file2. so I would like reduce the...
  16. tonivm

    Hi everybody: Could anybody tell

    Hi everybody: Could anybody tell me how I can print from a file a selected rows with awk. In my case I only want print in another file all the rows from NR=8 to NR=2459 and the increment each 8 times. I tried to this: awk '{for (i=8; i=2459; i+=8); NR==i}' file1 > file2 and awk 'NR%8==0 &&...
  17. tonivm

    Manipulate files

    I would like to know how I can delete the carriage return of each line in each block. :D
  18. tonivm

    Manipulate files

    Sorry: But I think that the question coulb be more simple. Each block at the end of line manually I have seen that with one "supr" the next line becomes in the same than previous. Then I would like to know how I can eliminate the final carriage return that there is in each line. Thanks. :D
  19. tonivm

    Manipulate files

    Hi everybody: I have a problem. I have a output files which have this pattern: number1 --space block1a - 7rows/10columns/65elements --space block1b - 7rows/10columns/65elements --space block1c - 7rows/10columns/65elements --space number2 --space block2a - 7rows/10columns/65elements --space...
  20. tonivm

    traspose rows in columns

    Hi everybody: I have a new problem, I have a file where the data is stored like: 1.000E+02 6.549E+01 4.252E+01 2.755E+01 1.786E+01 1.163E+01 7.660E+00 5.140E+00 3.550E+00 2.560E+00 1.950E+00 1.570E+00 1.330E+00 1.190E+00 1.100E+00 1.040E+00 1.010E+00 9.800E-01 9.600E-01...

Part and Inventory Search

Back
Top