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...
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
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
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
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...
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
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
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]=...
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
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
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...
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...
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 =...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.