• 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 t$$anonymous$$s 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 t$$anonymous$$s 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 w$$anonymous$$ch 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 t$$anonymous$$s picture, Notepad fully recognizes the text contained in the file. The Unity Inspector on the right, however, shows not$$anonymous$$ng. When I try printing the file's text through C#, it prints blank. I've tried restarting everyt$$anonymous$$ng, reimporting the file, and creating a new file with the same text. Not$$anonymous$$ng has helped so far.

alt text

If someone could help, I would really appreciate it!

Update: I tried removing t$$anonymous$$ngs 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 w$$anonymous$$te 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 Mic$$anonymous$$gan 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 Mic$$anonymous$$gan to the river and build a breakwall to protect our harbor from strong waters.

  • Dig a new “Straight Cut” to connect Lake Mic$$anonymous$$gan 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 s$$anonymous$$ps.

  • Have s$$anonymous$$ps 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, t$$anonymous$$nking they might be a problem. Not$$anonymous$$ng. I removed half at a time, not$$anonymous$$ng until I got through everyt$$anonymous$$ng. 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 not$$anonymous$$ng. As long as one entry from t$$anonymous$$s column exists, Unity can't read the file (and it doesn't matter w$$anonymous$$ch 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

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

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

Download Files 2 Answers

Where are my textures 1 Answer

Using groups of prefabs between projects 1 Answer

File.Move wont work , error. IOException: Win32 IO returned ERROR_ALREADY_EXISTS. Path: 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