• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
Question by BSummers · Aug 16, 2018 at 11:11 PM · filestext file

.txt file is empty in Unity?

Hello,

Fixed: After struggling with this all day and giving in and posting a question on here, I found the issue: both the quotation marks and single-quotes were in rich text. After using find-replace to replace them with generic forms, the file loads. Gosh dangit. Hopefully this helps someone else.

I'm trying to use tab-delimited text files to store information for my game. I have five of these, four of which all work perfectly as expected. The last, and largest (8kb vs all others of 1kb), does not show up as having any text in Unity.

As you can see in this picture, Notepad fully recognizes the text contained in the file. The Unity Inspector on the right, however, shows nothing. When I try printing the file's text through C#, it prints blank. I've tried restarting everything, reimporting the file, and creating a new file with the same text. Nothing has helped so far.

alt text

If someone could help, I would really appreciate it!

Update: I tried removing things from the file and found that one specific column is causing problems.

  • Evict the fisherfolk and expand the factory onto the fisherfolk’s former village

  • Let the fisherfolk village and the factory both stay on Jones Island and don’t expand or evict either one.

  • Help resettle the fisherfolk and expand the factory onto the fisherfolk’s former village.

  • Make the factory relocate and let the fisherfolk stay on the island.

  • Fill the wetland by scraping down bluffs and connect industry to canals.

  • Set aside some wetland for Native peoples who were displaced by white settlement.

  • Use the wetland as a dump for waste.

  • Leave the wetland as a nature sanctuary and build new industry on currently dry land only.

  • Build a dam and start digging a canal from Lake Michigan to the Mississippi River.

  • Build a dam to use for water power only.

  • Invest in a railroad expansion instead of building a canal.

  • Let the river run free.

  • Dig a new “Straight Cut” to connect Lake Michigan to the river and build a breakwall to protect our harbor from strong waters.

  • Dig a new “Straight Cut” to connect Lake Michigan to the river but do not pay for a breakwall to protect the harbor from strong waters.

  • Dredge and scrape out the natural river mouth so it is deeper for ships.

  • Have ships use the natural river mouth.

  • Cover the river with a grand boulevard.

  • Flush the river out with a huge new pump.

  • Build a sanitary sewer system and a water treatment plant.

  • Employ “carriage sweepers” to clean up horse manure in the streets.

I tried removing the entries with the quotation marks, thinking they might be a problem. Nothing. I removed half at a time, nothing until I got through everything. Tried that in reverse, same effect. For some reason, I have to remove the entire column before Unity can read the file. And, it's only that column; deleting other columns does nothing. As long as one entry from this column exists, Unity can't read the file (and it doesn't matter which entry).

untitled.png (47.7 kB)
Comment

People who like this

0 Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image RShields · Aug 17, 2018 at 03:38 AM 1
Share

Not a proper solution, but you should probably store them in a highly parse-able format like JSON or XML.

0 Replies

  • Sort: 

Unity Answers is in Read-Only mode

Unity Answers content will be migrated to a new Community platform and we are aiming to launch a public beta by June 9. Please note, Unity Answers is now in read-only so we can prepare for the final data migration.

For more information and updates, please read our full announcement thread in the Unity Forum.

Follow this Question

Answers Answers and Comments

89 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Write to a file 1 Answer

Flash publishing - read string from external data file 0 Answers

Displaying PDF 5 Answers

Git status shows shader files as modified even though the are unchanged 1 Answer

Using async WebRequest GetResponse 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges