I'm learning to script with gawk, and have a small problem.
I have a file that represents a stock sheet
name1|18
name2|15
name3|4
I'm trying to modify the last field.
Is there a way to do this using print >> statements?
does print >> always append to the end of a file, even if
it's open?
Basically, i have a number x, the name2 value, and want to replace 15 with 15-x. Is there a simple(conceptually) way to do this?
I apologize if this is a simple question, I searched for similar problems but i just don't know enough about gawk to understand the solutions i saw.
I have a file that represents a stock sheet
name1|18
name2|15
name3|4
I'm trying to modify the last field.
Is there a way to do this using print >> statements?
does print >> always append to the end of a file, even if
it's open?
Basically, i have a number x, the name2 value, and want to replace 15 with 15-x. Is there a simple(conceptually) way to do this?
I apologize if this is a simple question, I searched for similar problems but i just don't know enough about gawk to understand the solutions i saw.