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.

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

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.