- Home /
Maximum file size for .txt asset? Unity crashes when importing large text file
Is there a maximum file size when importing text assets?
Unity 5.4.0 crashes every time I try to import the 1.2GB text file needed for my project, but works fine for a smaller version (85MB).
When I relaunch Unity, there is a console comment: "A default asset was created for 'Assets/particles.txt' because the asset importer crashed on it last time. You can select the asset and use the 'Assets -> Reimport' menu command to try importing it again, or you can replace the asset and it will auto import again."
I have tried reimporting the asset as suggested (Unity crashes again), deleting the default asset created and importing again (Unity crashes), creating a new project and importing there (Unity crashes), restarting the computer and trying all of the above (Unity still crashes). I have opened the file in a text editor and can't see anything obviously wrong with it, although since it has 16 million lines I haven't exactly checked it all...
I have submitted a bug report.
Answer by Trevdevs · Sep 09, 2016 at 10:36 AM
I'm not quite sure what your doing that you need a 1.2GB txt file... but Unity does tend to crash when you try importing things that pass a certain size. Such as importing to large of a movie texture. Really the only way I can see of fixing this is A. Try and reduce your fize size somehow or B. Break up your file into smaller separate txt's.
I'm working on a data visualisation research project, so this isn't even the biggest file I'd like to import. Guess I'm just going to have to try splitting it into smaller and smaller files until I find the limit. Is it stated anywhere, or is this just something that one finds out by trial and error?
Answer by m0guz · Sep 12, 2016 at 04:37 AM
You don't need to import your .txt files to project/assets. You can use Application.persistentDataPath folder to store text/data files and you can read/use them with .NET StreamReader or your custom file reader.
Your answer
Follow this Question
Related Questions
Why is Unity crashing when I import an asset from Maya? 0 Answers
Unity import assets crash 0 Answers
How do I open an existing project in Unity? 6 Answers
Editor crash on all scenes and projects 1 Answer
How to check integrity of Assets? 0 Answers