non interactive vim

I wanna edit a file non-interactively using vim editor

The file contains a line:
ACTIVATIONCODE=

I have a variable called ACT. I want to edit the file non-interactively using vim such that the concerned line is converted to:

ACTIVATIONCODE=contents of the variable ACT

---------- Post updated at 05:03 AM ---------- Previous update was at 05:01 AM ----------

If the contents of the variale is 1234abcd(say)
Then the line should look like ACTIVATIONCODE=1234abcd

# -i only available on GNU sed
sed -i -e "s/\(ACTIVATIONCODE=\)/\1${variable}/" yourfile
# Won't change, you'll have to copy over
awk -v code=${variable} '/ACTIV/{$0=$0.code;}{print}' yourfile
# What you wanted
echo "/ACTIVATION^MA${variable}^[:wq^M" | vim test.txt

Note for the last example: ^M isn't 2 characters, but a newline, and ^[ is the representation of ESC. Both can be entered by pressing CTRL+V and the appropriate key.