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 dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by krava

  1. krava

    gappy table

    Hi, Could somebody help me to solve this problem? I copy here part of the table (I hope it will keep the format when you receive this thread): ESO 268-044 4a 70.0 9.0 272.3 251.8 113.1 2.2 14.5 10 2 ESO 323-042 4c 54.0 9.0 160.1 4.0 ESO 358-006 4b 48.5...
  2. krava

    extract number

    ok... this works fine....thanks for the tip
  3. krava

    extract number

    hi I have file names like: "data1", "esdu2sdt" ... "da15efe" I would just like to extract number from filenames. There is absolutely no rule where the numbers are in the names. How to do this? thanks k.
  4. krava

    duplicated records

    Hi I would like to remove duplicated records based on 3 columns. For example, 1 2.2 3.2 4.2 2 3.2 4.2 5.2 3 4.2 5.2 6.2 4 5 5 5 5 5 5 5 6 7.2 8.2 9.2 7 8.2 9.2 10.2 8 5 5 5 9 10.2 11.2 12.2 10 11.2 12.2 13.2 I would like to get 1 2.2 3.2 4.2 2 3.2 4.2 5.2 3 4.2 5.2 6.2 4 5 5 5 6 7.2 8.2...
  5. krava

    delete blanko characters

    sed way is ok ... thanks. it tr way there is nothing reported just does not do the job
  6. krava

    delete blanko characters

    it does not work in this way ... sure the syntax is ok? I am trying to run it with in BASH like: usage: cleanBlanko "inputFile.csv" function cleanBlanko(){ for i in `find -name "$1" -print`; do echo $i "=============>" "$(dirname $i)"/"$(basename $i .csv)"_delBl.csv; tr -d ':blank:' <$i...
  7. krava

    delete blanko characters

    Hi, I have datafile (comma separated) like this one 342, 0.00279, 0.01163, 3.03125 342, 0.00279, 0.01163, 3.03125 342, 0.00279, 0.01163, 3.03125 342, 0.00279, 0.01163, 3.03125 .................................. and I would like to delete empty...
  8. krava

    crossmatching

    Thanks, I am trying to generalise this that is to match 2 files usin 2 columns in both files. For example to match 1 and 2 columns of file1 with columns 3 and 4 of file2 #USAGE:test_awkcrossmatch file1 1 2 file2 3 4 output test_awkcrossmatch() { awk -F, -v col1_fl1="$2" -v col2_fl1="$3"...
  9. krava

    crossmatching

    I wrote awk for matching of 2 files using the same columns like this: #USAGE: awkcrossmatch file1 file2 2 output test_awkcrossmatch() { awk -F, -v col1="$3" 'NR==1 { h=$0 ; next} {v=$col1} NR==FNR {a[v]=$0; print v, a[v]; next} NR==1 { print h FS $0 ; print v; next } v in...
  10. krava

    crossmatching

    Hi, I would like to cross-match 2 files with awk using different columns. Example: file1 with 3 CSV columns: A1,B1,C1 1,2,3 4,5,6 7,8,9 file2 similary: A2,B2,C2 2,11,13 7,34,56 8,32,12 Matching 2 files using B1 column of the first file and A2 column of the second should give...
  11. krava

    substitute string

    thanks o=`echo | awk 'BEGIN { ... }'` works fine in this context
  12. krava

    substitute string

    hi, i would like to substitute a substring with the given string in filanames. I wrote this script that use awk: function subFlNmPart(){ for i in `find -name "$1" -print`; do bn="$(basename $i)"; #eval o=\"$( awk -v inFl=$bn -v target=$2 -v word=$3 'BEGIN{ sub(target, word, inFl)...
  13. krava

    print out columns

    thanks for reply...works fine
  14. krava

    print out columns

    hi, I would like to write out certain columns (number is not fixed) from datafile. My program starts like: echo "chose columns separated by commas"; read col; awk -v c=$col 'BEGIN{ search=","; n=split(c,a,search); for (i=1;i<=n;i++) { print a[i]; }}{......}' dataFile.dat >...
  15. krava

    sort data

    Hi I would like to sort datatable by column 2 for example. I wrote this: awk '{a[$2>=10?$2:0$2]=$0} END {n=asorti(a,dest); for (i=1;i<=n;i++){print dest[i]}}' sample1.dat It works but fails when I have negative numbers in datatable. Is there some quick solution for this? thanks k.

Part and Inventory Search

Back
Top