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: vidmo
  • Order by date
  1. vidmo

    copy lines whilst adding an incremental column

    a solution: for i in 0.1 0.2 0.3 0.4 0.5 0.6 0.8 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 do awk '{print $1, '"$i"', $2, $3, $4, $5, $6, $7, $8}' ${file}temp3.txt > s${file}$i.txt done cat s${file}*.txt | sort > ${file}_fin.txt thanks anyway
  2. vidmo

    copy lines whilst adding an incremental column

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

    average part of column

    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}...
  4. vidmo

    average part of column

    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...
  5. vidmo

    second array?

    it's ok- got it maxd[$1]=$4 cheers anyway
  6. vidmo

    How create new column file from other files!!!

    you could always do: paste file1 file2 | awk '{print $6, $2, $7, $8, $5}' > out vidmo
  7. vidmo

    second array?

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

    find maximum values in file

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

    find maximum values in file

    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...
  10. vidmo

    find maximum values in file

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

    wildcard in loops

    thanks very much, both of you, feherke- can i ask why the extra brackets enable the wildcard? thanks vidmo
  12. vidmo

    wildcard in loops

    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 ]...
  13. vidmo

    find records within certain parameters

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

    find records within certain parameters

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

Part and Inventory Search

Back
Top