# How to enter special characters in a text file using vi?

**URL:** <https://community.unix.com/t/how-to-enter-special-characters-in-a-text-file-using-vi/355406>\
**Category:** UNIX for Dummies Questions & Answers\
**Created:** [September 15, 2015, 7:15pm UTC](https://community.unix.com/t/how-to-enter-special-characters-in-a-text-file-using-vi/355406 "2015-09-15T19:15:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![newbie\_01](https://community.unix.com/letter_avatar/newbie_01/32/5_5575768a8748004e209b776fc1b2916d.png) [@newbie\_01](https://community.unix.com/u/newbie_01)\
**Post date:** [September 15, 2015, 7:15pm UTC](https://community.unix.com/t/how-to-enter-special-characters-in-a-text-file-using-vi/355406/1 "2015-09-15T19:15:37Z")

</div>

Hi,

I need to create a test text file with the special characters \342\200\223 in it and to be able to use sed maybe to delete them

I tried doing it using vi by pressing CTRL-V and then typing 342 but it does not work. After pressing CTRL-V and typing 342 it seems to just insert the numbers 342 in it, tried doing CTRL-V and then \342 does not work either.

Eventually, I would want to search and delete all non-printable characters but at the moment, this is what I am wanting to test on as these characters appear intermittently in a file that I am trying to load into the database.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![in2nix4life](https://community.unix.com/user_avatar/community.unix.com/in2nix4life/32/709_2.png) [@in2nix4life](https://community.unix.com/u/in2nix4life)\
**Post date:** [September 15, 2015, 8:15pm UTC](https://community.unix.com/t/how-to-enter-special-characters-in-a-text-file-using-vi/355406/2 "2015-09-15T20:15:18Z")

</div>

Make sure you're using vim, and not vi.

In the file, switch to INSERT mode. Hit CTRL-V and release. Should see a ^ symbol. Type in the numeric value for the character.
