The following symbol shows up when i view my file in vim.
---<snip>----
^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@fstalone
---<snip>-----
The file that I create is by redirecting stdout and stderr of my utility, like this: #./my_util > util.log 2>&1. This file tend to grow quite huge ( ~4 MB )
- What is this symbol?
- How to get rid of it?
That is the null character, in a format (which Vim uses a lot, as you’ve probably noticed) called caret notation. Basically, somehow you’re getting bytes full of zeros into your file.
Since we don’t know what your utility is doing, if it’s the culprit, you’ll need to show us some code if you want us to help. Otherwise, if you just want to remove the characters from your file, use a substitution:
Ctrl-Vmarks the beginning of an escape sequence. After pressingCtrl-Jas well, you should see^@appear in your command. Thus, as you guessed,Ctrl-V, Ctrl-Jis one escape sequence for the null character.