# Write variable with special character to a text file

**URL:** https://www.finalbuilder.com/forums/t/write-variable-with-special-character-to-a-text-file/6658
**Category:** Discussion
**Created:** [November 20, 2019, 12:15pm UTC](https://www.finalbuilder.com/forums/t/write-variable-with-special-character-to-a-text-file/6658 "2019-11-20T12:15:53Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![efridman](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/e/a88e57/32.png) [@efridman](https://www.finalbuilder.com/forums/u/efridman)
#### Post date: [November 20, 2019, 12:15pm UTC](https://www.finalbuilder.com/forums/t/write-variable-with-special-character-to-a-text-file/6658/1 "2019-11-20T12:15:53Z")

</div>

Hi

I have an action that load variable from a file, the value may include special character like %

Now I need to write the value to a .bat file but in case the string include % it should be duplicate and be %%

What is the easiest way to do that ?

I understand that I need to use %!VARIABLE% in order to escape special characters in FinalBuilder but don’t know how to make it duplicate.

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [November 21, 2019, 6:12am UTC](https://www.finalbuilder.com/forums/t/write-variable-with-special-character-to-a-text-file/6658/2 "2019-11-21T06:12:57Z")

</div>

I guess the the String Replace action would do the trick.

[EscapePercent.fbp8](https://www.finalbuilder.com/forums/uploads/short-url/wiIJJ7iw1sDSYkUGWTy2378DAMh.fbp8) (2.0 KB)

---

<div class="post-metadata">

### Author: ![efridman](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/e/a88e57/32.png) [@efridman](https://www.finalbuilder.com/forums/u/efridman)
#### Post date: [November 21, 2019, 2:35pm UTC](https://www.finalbuilder.com/forums/t/write-variable-with-special-character-to-a-text-file/6658/3 "2019-11-21T14:35:42Z")

</div>

Thanks, that does the work.
