Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • 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 /
  • Help Room /
avatar image
0
Question by najak3d · Aug 18, 2018 at 08:18 PM · textassetcsvexcel

Why does Unity fail to read CSV exported from Excel 2010?

This is so frustrating. I have Excel 2010 where we are editing CSV data. But when I save this CSV from Excel, Unity cannot read it as Text Asset! But if I then just load with NotePad+ and save it -- then Unity can read as Text Asset.

I even took the CSV file saved from Excel and used Windows Explorer to Ctrl+C then Ctrl+V (copy/paste in place) -- and it created a copy just fine -- and Unity could read the COPIED file just fine. But not the original file.

We use SVN, it shows zero differences in the file for check-in. Yet somehow Unity seems to care how the file was last saved -- Text Editor (works fine), but Excel 2010 fails entirely.

This is not acceptable. It's like Unity is going out-of-its-way to do something that is very pointlessly frustrating, and even seems impossible.

Why would/should Unity care which program saved it? And why then would a Windows Explorer Copy/Paste then create a file that Unity can read just fine?

Yeesh.

Comment
Add comment · Show 3
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 eses · Sep 12, 2018 at 08:57 AM 0
Share

I don't have Excel 2010, but 2016. I've been able to read CSV files created with excel in Unity. I just tested that created file reads into Unity as TextAsset, I'm able to debug.Log the contents.

CSV is just a text file with different file extension -maybe there are some settings for text encoding - at least in 2016, the format to save csv is utf-8 in save dialog.

avatar image Hellium · Sep 12, 2018 at 10:26 AM 1
Share

Are you sure Excel is not running when you try to read the file with Unity? You may have an access issue (Unity is trying to read a file locked by Excel)

Do you get any error in the console?

avatar image eses Hellium · Sep 12, 2018 at 12:42 PM 0
Share

@Hellium - I just noticed this question was sort of necro'ed by this guy selling his asset (he has spammed his asset as solution to several csv questions. OP asked his question weeks ago...

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by MyUnitydream · Sep 12, 2018 at 05:12 AM

you can use Uni-Excel Package for Read, Write, and edit excel files

https://assetstore.unity.com/packages/tools/uni-excel-47540

Comment
Add comment · Share
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
0

Answer by maximilianahead · Oct 22, 2019 at 01:47 PM

Because you are opening csv by EXCEL so close it and free.

However, you can read open files by following.

 using (FileStream fs = new FileStream("test.csv", FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
 using (TextReader sr = new StreamReader(fs))
 {
     content = sr.ReadToEnd();
 }






Comment
Add comment · Share
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

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.

Follow this Question

Answers Answers and Comments

152 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 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

Serialize properties of the custom editor itself 0 Answers

How can I save spawned objects position in CSV? 1 Answer

how to write on textasset parameter 0 Answers

Read position data from Csv or txt file to move game object? 1 Answer

how to change asset set to script ? 0 Answers


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