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

  1. CaKiwi

    Help Splitting Field of Input File

    I'm a little confused about what the code you posted is trying to achieve, but the following produces your desired output from your given input /departmentNumber/{ a = $2 " " $3 j = index(a, "-") if (j) { print substr(a, 1, j-1) "," substr(a, j+1) "," a } next } {printf...
  2. CaKiwi

    MS Word Font Color

    Hmmm. Most of the documents in question have come from someone else and I have no control over what they use. But the ctrl-space will be a big help. Thanks for your assistance. CaKiwi
  3. CaKiwi

    MS Word Font Color

    Thanks macropod. Is there some way of always defaulting to standard text without having to press ctrl-space? CaKiwi
  4. CaKiwi

    MS Word Font Color

    Thanks for the replies. Track changes is working ok for me. Another question, is there a way to have any text I type keep the attributes of the current default text (font, color, bold etc) rather than pick up the attributes of adjacent text? CaKiwi
  5. CaKiwi

    MS Word Font Color

    I have a Word document which uses black characters. I want all changes I make to be in red. What is the easiest way to do this? Thanks in advance. CaKiwi
  6. CaKiwi

    Distributing a Cygwin C program

    Thanks ArkM, using the -mno-cygwin option described in the second link you gave me worked perfectly CaKiwi
  7. CaKiwi

    Distributing a Cygwin C program

    I want to create a program using cygwin gcc on one system and run it on another. One way to do this is to copy cygwin1.dll to the second system along with the program. However I understand that it is possible to link the program with Windows libraries but I can't find the syntax needed. Thanks...
  8. CaKiwi

    How to get a number from a String

    You're welcome, glad it worked for you CaKiwi
  9. CaKiwi

    How to get a number from a String

    What operating system are you using? I'm guessing windows. If so, put this code into a file test.awk /Production on/ {a= $6 " " $7 " " $8 " " $9 " " $10 ","} /FILE_ONE/ {a=a substr($NF,10)} $2==2 {b[++i]= ", " $3} END {print a b[1] b[2] b[3]} Then run by using gawk -f test.awk test.txt CaKiwi
  10. CaKiwi

    How to get a number from a String

    I copied the line for the 2nd method I gave above and pasted it into a terminal. It worked without error. What error do you get with the 1st method using test.awk? CaKiwi
  11. CaKiwi

    How to get a number from a String

    What errors or results did you get? You can put the program into a file, test.awk say, and run it with gawk -f test.awk test.txt Or you can put include the program on the command line gawk '/Production on/ {a= $6 " " $7 " " $8 " " $9 " " $10 ","}/FILE_ONE/ {a=a substr($NF,10)} $2==2 {b[++i]=...
  12. CaKiwi

    How to get a number from a String

    I meant 10.5 and 109.5, of course CaKiwi
  13. CaKiwi

    How to get a number from a String

    This may get you started. I assumed 10.7 in the file and 109.7 in the required output were supposed to be the same number /Production on/ {a= $6 " " $7 " " $8 " " $9 " " $10 ","} /FILE_ONE/ {a=a substr($NF,10)} $2==2 {b[++i]= ", " $3} END {print a b[1] b[2] b[3]} CaKiwi
  14. CaKiwi

    Vim Syntax Highlighting

    The part I was missing was to put my file type in the filetype.vim file (in /usr/share/vim/vimcurrent on my system). I found it by searching for f77 in the vim directory. It must be mentioned in the doc somewhere, but I didn't find it, although reading doc is not my forte. CaKiwi
  15. CaKiwi

    Vim Syntax Highlighting

    Thanks for the response, Annihilannic. I think the piece I'm missing is how to get vim to recognize a new file type. Fortran has a few of the same key words (if, endif, do, etc) so I copied the fortran syntax file as a pp syntax file but nothing was hightlighted. Any help greatly appreciated...
  16. CaKiwi

    Vim Syntax Highlighting

    I am trying to create a very simple syntax highlighting file for vim. Highlighting is working for standard files such as .vim files Example file t.pp LN1 = LINE/0,0,2,0 $$ COMMENT LN2 = LINE/PARLEL,LN1,XLARGE,1 % COMMENT $$ COMMENT % COMMENT I want the word LINE...
  17. CaKiwi

    regexp with round brackets

    One way is to use 2 sub statements sub(/\(/,"",r[i]) sub(/\)/,"",r[i]) CaKiwi
  18. CaKiwi

    for loop doesn't execute

    Change == to <= in your for statement for( i = 1; i <= number_of_pc; i++ ){ Or you could do it slightly differently BEGIN { print "PARSER"} NR==FNR{ pc[$1] = 1 next } #reading of the first file finished. #Starting with the second one pc[$1]{ pc_disass = $1 instruction = $6 register =...
  19. CaKiwi

    Get minimum value rows

    Try this min[$1]=="" || min[$1]>=$3 { if (min[$1]==$3) { data[$1] = data[$1] "\n" $0 } else { min[$1]=$3 data[$1]=$0 } } END{for(i in min) print data[i]} CaKiwi
  20. CaKiwi

    AWK including headers

    What are you trying to do? head -0 prints the first zero lines of input, i.e. nothing CaKiwi

Part and Inventory Search

Back
Top