Here's the input file structure (it will always have exactly 9 lines and exactly 8 records per line):
x1 x2 x3 x4 x5 x6 x7 x8
x9 xN etcetera
These are just numbers, auto-generated by another program.
I want to rewrite some of them with specific values:
x1 0 105 166 x5 0 116 156
x9 0 etcetera
(basically, I am changing the values for RGB triples - and the new colors are constants)
I tried doing something like:
- Code: Select all
print $1,0,105,166,$5,0,116,156
but this prints the same RGB values for every line, with only the first and 5th records changing.
I'm thinking that maybe getline is the way to go with this, but I don't quite understand how to use it.
Please help?
EDIT: actually, it doesn't have to be in awk. Whatever works is going into a larger bash script. Sadly, I think awk is my strongest programming language...


