An alternative is to use sponge
:
awk '{print $0}' your_file | sponge your_file
Where you replace '{print $0}'
by your awk script and your_file
by the name of the file you want to edit in place.
sponge
absorbs entirely the input before saving it to the file.