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

    remove 0s

    I posted this message to awk forum but other solutions are accepted too. Hi Does anybody have an idea how to remove leading zeros from this data ie. to transform this HD000245 HD001358 HD020400 HD000093 HD000007 ........ to HD245 HD1358 HD20400 HD93 HD7 ....... thanks o
  2. ovince

    function in .bashrc

    I already tried cd $p but doesnotwork unfortunately
  3. ovince

    function in .bashrc

    thanks PHV Do you have a tip how to change dir? `cd $p` does not work in this form oliver
  4. ovince

    function in .bashrc

    Hi I would like to put a function into .bashrc file that would: open a new Konsole and cd into the result of pwd command. Something like: pwdinnk() { p=`echo pwd` echo $p `dcop $KONSOLE_DCOP newSession` `cd $p` } This does not work. In details: 1. The echo $p part does not give me...
  5. ovince

    header

    thanks Feherke And what to do in this case ... I want to write out some columns like: awk 'BEGIN {FS=",";OFS=","} /^#/{next} {print $58,1/($63*$63)}' file.csv file > file1.csv As you see, I skeep header because 1/($63*$63) operation would report error if I do not skeel it. But steel I...
  6. ovince

    awk with gnuplot

    Hi All Is it posible to use awk with gnuplot? That is, can I plot data directly extracted from file by awk like: awk 'BEGIN {FS=","}{print $53, $58}' | gnuplot ... thanks oliver
  7. ovince

    bashrc variables

    Hi All, I can not find any documentation on what is the difference when I define some variable in .bashrc file like for example: COS_PATH=+$COSSPEC2D_DIR/pro:$COS_PATH and COS_PATH=$COSSPEC2D_DIR/pro:$COS_PATH (ie without +). Could somebody tell me? Also I am not sure when to export...
  8. ovince

    header

    Hi All, I join 2 files matching columns like awk 'BEGIN{FS=",";OFS=","} NR==FNR{a[$1]=$1;b[$1]=$23;c[$1]=$44;next} $1 in a {print a[$1],$1,b[$1],c[$1], $2, $3, $4, $5}' filq e1.csv file2.csv > joined.csv I have headers in file1.csv and file2,csv.How to keep corresponding headers in...
  9. ovince

    delete column

    sory...Ygor's suggestion with cut works and awk 'BEGIN{FS=",";OFS=","}{$1=$6="";gsub(FS "+",FS)}1' file.dat > newFile.dat leave ',' in front of each line
  10. ovince

    delete column

    thanks I have a csv file and I would like to keep like that. This try does not work if I want to remuve 1 column (i.e it leaves ',' in front of lines) awk 'BEGIN{FS=",";OFS=","}{$1=$6="";gsub(FS "+",FS)}1' file.dat > newFile.dat Feherke's suggestion is OK
  11. ovince

    delete column

    hi All, I would like to delete 2 columns from 60 columns data. How to do that except to write awk '{print $1, $2 .... $60}' file.dat > newFile.dat leaving out columns that I dont want in a newFile.dat? thanks oliver
  12. ovince

    deleting file-content

    hi is there an easy way to delete the content of the file but leaving an empty files in the directory? oliver
  13. ovince

    string manipulation in BASH

    thanks. this works expr match "$fileName" '.*box' but how come that expr match "$fileName" '.*_tri' does not find the position of '_'(ie the position of the end of the number)? o.
  14. ovince

    string manipulation in BASH

    Hi All, I would like to extract numbers 5, 15, 35 from filenames like (the second number in name): join5x_angle_box5_tri.dat join5x_angle_box15_tri.dat join5x_angle_box35_tri.dat .... How to do this? I was thinking to apply command like `expr index "$fileName" '.*box.*'` in a loop, but...
  15. ovince

    getline problem

    hi, could somebody tell what is wrong with this command awk 'BEGIN {"read c" | getline vc close("read c"); print vc}' the idea is to read in some variable from STDIN and to use it in awk commands thanks oliver
  16. ovince

    normalization

    there is no problem but I wanted to automatise the process since I have many files
  17. ovince

    make 4-column

    paste is ok but after pasting I can not read in the obtained file as an ASCII with some Windows programs since it put some characters in the file. unix2dos does not help
  18. ovince

    find and copy

    thanks Columb I use Cygwin and I am very very new in Unix. I read manual every time befor posting but sometimes I can not understand everything so I post question here.
  19. ovince

    find and copy

    hi I would like to copy files that find command finds somehow. None of this does not work find less/DH* more/DH* -type f -name "all*.dat" -exec cp "c:\users\" find less/DH* more/DH* -type f -name "all*.dat" | cpio -pdumv "c:\users\" how to do properly this? thanks oliver
  20. ovince

    normalization

    hi I would like to normalize second column of dataFile to number at 1000 row of second column. I do this by looking what number I have in 1000th row of second column first and then awk'{print $1, $2/23.45}' file Must be an easier way to do this I am sure. some suggestions? thanks

Part and Inventory Search

Back
Top