How can i open txt file outside the unity editor. When i have already finshed the game.
I want to open a txt file and then edit it, so that there aren´t any numbers left. I need it becasuse i want to create an App that takes a txt file takes the numbers out and overwrite the old file.
Answer by pauls_unity · Oct 17, 2017 at 10:38 AM
Hi XLionfresh.
You should be able to use StreamReader and StreamWriter to read from and write to files. Here is some sample code that. You can also read and parse the Files using String methods such as Split() etc. Here is an example that should be useful: https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/strings/how-to-parse-strings-using-string-split
The method you should use to parse your strings (assuming numbers are separated by a space or comma) would be simpler than the example given in the link above as you would only need one delimiter. Split() can also take a single character as well as an array.
-Paul