# Writing Data to a Text File

**URL:** <https://forums.unrealengine.com/t/writing-data-to-a-text-file/2067932>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine, question\
**Created:** [October 14, 2024, 1:29pm UTC](https://forums.unrealengine.com/t/writing-data-to-a-text-file/2067932 "2024-10-14T13:29:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![eviand7](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@eviand7](https://forums.unrealengine.com/u/eviand7)\
**Post date:** [October 14, 2024, 1:29pm UTC](https://forums.unrealengine.com/t/writing-data-to-a-text-file/2067932/1 "2024-10-14T13:29:15Z")

</div>

I want to create a text file at the start of each game and, for example, when the player is in certain areas, I want to write this into the file with the time and entry/exit direction information. How can I write such data to a text file? Can this be done using Blueprints? Or could it be done with Python?

---

<div class="post-metadata">

**Author:** ![VisAgilis](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/visagilis/32/891043_2.png) [@VisAgilis](https://forums.unrealengine.com/u/VisAgilis)\
**Post date:** [October 14, 2024, 1:49pm UTC](https://forums.unrealengine.com/t/writing-data-to-a-text-file/2067932/2 "2024-10-14T13:49:03Z")

</div>

I think your objective is saving the player’s progress. Here’s the documentation on saving & loading a game:

> **[Saving and Loading Your Game in Unreal Engine | Unreal Engine 5.5...](https://dev.epicgames.com/documentation/en-us/unreal-engine/saving-and-loading-your-game-in-unreal-engine)**
>
> Overview of how to save and load your game

And here’s a tutorial:

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/f/a/bfa85670044fd09c98c42cbab6db363b3e8aab0c.jpeg "How to Save and Load your Game In Unreal Engine 5 (Easy)") ](https://www.youtube.com/watch?v=14wmGdbhLOA)

Hope these help! 😊

---

<div class="post-metadata">

**Author:** ![eviand7](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@eviand7](https://forums.unrealengine.com/u/eviand7)\
**Post date:** [October 15, 2024, 10:57am UTC](https://forums.unrealengine.com/t/writing-data-to-a-text-file/2067932/3 "2024-10-15T10:57:53Z")

</div>

Thank you very much, yes this will help a little but actually I want to create documentation for later analysis when entering certain areas in the game. I will create trigger boxes and when the player enters those tigger boxes, information will be taken from each trigger box and written to the text files (can also be json) generated at the game opening. I want to read this file later. How can I write the data I will get from each trigger box to this file outside?

---

<div class="post-metadata">

**Author:** ![VisAgilis](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/visagilis/32/891043_2.png) [@VisAgilis](https://forums.unrealengine.com/u/VisAgilis)\
**Post date:** [October 15, 2024, 11:03am UTC](https://forums.unrealengine.com/t/writing-data-to-a-text-file/2067932/4 "2024-10-15T11:03:44Z")

</div>

Does this help?

> [@How can I write to text files?](https://forums.unrealengine.com/t/how-can-i-write-to-text-files/280116/2):
>
> #CoreMisc.h \_\_ I thus make your entire project super happy fun with this one .h file !!! Read all the functions here!!! CoreMisc.h /\*\* \* Parses a string into tokens, separating switches (beginning with - or /) from \* other parameters \* \* @param CmdLine the string to parse \* @param Tokens [out] filled with all parameters found in the string \* @param Switches [out] filled with all switches found in the string \*/ static void Parse(const TCHAR\* CmdLine, TArray\<FString\>& Tokens…
