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 TouchToneTommy 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: tonivm
  • Content: Threads
  • Order by date
  1. 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...
  2. 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...
  3. 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...
  4. 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...
  5. 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...
  6. 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...
  7. 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...
  8. 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 &&...
  9. 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...
  10. 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...
  11. tonivm

    Delete repeated rows from a file

    Hi everybody: Could anybody tell me how I can delete repeated rows from a file?, this is, for exemple I have a file like this: 0.490 958.73 281.85 6.67985 0.002481 0.490 954.833 283.991 8.73019 0.002471 0.590 950.504 286.241 6.61451 0.002461 0.690 939.323 286.112 6.16451 0.00246 0.790 928.17...
  12. tonivm

    declare a field as empty

    Hi everybody: Could anybody tell me how should I declare into a if stament? Is it possible like this?: if ($field == " ") body Thnaks in advance and cheers!! . :D
  13. tonivm

    divide one files depnds on minimum value of a column

    Hi everybody: Anybody can tell me how from a file like: 2007,7,30,23,0,4,6610,518,286.35,958.73,62.9,, 2007,7,30,23,0,6,6610,531,286.45,957.2,60.9,, 2007,7,30,23,0,6,6610,538,286.55,956.43,59.9,, 2007,7,30,23,0,12,6610,567,286.25,953.14,58.5,, 2007,7,30,23,0,14,6610,576,286.25,952.14,58.4...
  14. tonivm

    Execute script into Fortran script

    Hi everybody: I'm newbie in fortran language, and I would like to inicializate a script into Fortran programe. I use Microsoft Developer Studio. I tried this like: call system('start /w C:PATH\xxx.exe>>output.dat') or another option like: a=system('C:PATH\xxx.exe>>output.dat') but they did...
  15. tonivm

    copare first field from two files and create new

    Hi everybody: Could anybody tell me how can I compare two files (the first field) and create a new file with the common lines? Thanks in advance and cheers for everybody. :)
  16. tonivm

    delete zeros in a row

    hi everybody: Could anybody tell me how I can from a row which is: 00 01 02 03 04 05 06 07 08 09 10 11 ...... delete the first zero and then I will have: 1 2 3 4 5 6 7 8 9 10 11 ........ Thanks in advance and cheers. :)
  17. tonivm

    How create new column file from other files!!!

    Hi everybody: Anybody knows how create a new column file from two different files?. If we have a file1 that is as: ($nfn=field-file) $1f1 $2f1 $3f1 $4f1 $5f1 0 1013 294 14 6E-5 0.1 1001.9 293.6 13.53 6E-5 0.2 990.8 293.2 13.06 6E-5 0.3 979.7 292.8 12.59 6E-5 0.4 968.6 292.4 12.12 6E-5 and...
  18. tonivm

    compare files and calculating

    Hi everybody: Could anybody tell me how can I do this. I've two files (file1 & file2) where file1 its last row it has first field value equal that the first row in file2, thyen I want calculate the difference in other fields, and this values apply in file2. This is: file1...
  19. tonivm

    select numbers

    hi everybody: I have a file as: ...... 0.873 0.937 0.997 1.057 1.123 1.183 1.253 1.309 1.365 1.426 1.488 ...... and I would like to select the minimum and maximum from certain values as 1, 1.1, 1.2 so on to 4.5. This is in the first case 0.997<1<1.057. Thanks in advance and cheers. :)
  20. tonivm

    averaging each five times

    Hi everybody: I tried to do a script that average each five times, but i can't do it, and i've any mistake and i don't know where is. #!/bin/gawk -f BEGIN{FS = " ";c = 0;s = 0 ;}; { s = s+$15; c = c++ }; if (c == 5){ a = s/5; print $1, $2, a}; the file is separated by spaces...

Part and Inventory Search

Back
Top