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
1
Question by silverxah · Jul 21, 2016 at 10:12 AM · not workingvisual studioexportvisualstudioexcel

Exporting Data to Excel

How would I go about coding a script that would allow me to take data from a gyroscope and put it into either a data table exportable to Excel or directly onto Excel each frame? Also I don't have the money for Uni-Excel. I've tried using a slightly altered version of http://stackoverflow.com/questions/23041021/how-to-write-some-data-to-excel-file-xlsx but I am unable to reference the Microsoft.Office namespace even though I have Microsoft.Office.Interop.Excel added through VS 2015's add reference option. Any ideas? Thanks,

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

3 Replies

· Add your reply
  • Sort: 
avatar image
3
Best Answer

Answer by Don-Tako · Jul 25, 2017 at 10:07 PM

IF your data don't need format like colors, font styles, etc.. use CSV instead

 IEnumerator CrearArchivoCSV(string nombreArchivo)
 {
 
     string ruta = Application.persistentDataPath + "/" + nombreArchivo + ".csv";
 
     //El archivo existe? lo BORRAMOS
     if (File.Exists(ruta))
     {
         File.Delete(ruta);
     }
 
     //Crear el archivo
     var sr = File.CreateText(ruta);
     
     string datosCSV = "valor1,valor2,valor3,valor4" + System.Enviroment.NewLine;
     datosCSV += "valor1,valor2,valor3,valor4" + System.Enviroment.NewLine;
     datosCSV += "valor1,valor2,valor3,valor4" + System.Enviroment.NewLine;
     datosCSV += "valor1,valor2,valor3,valor4" + System.Enviroment.NewLine;
     datosCSV += "valor1,valor2,valor3,valor4";
     
     sr.WriteLine(datosCSV);
 
     //Dejar como sólo de lectura
     FileInfo fInfo = new FileInfo(ruta);
     fInfo.IsReadOnly = true;
 
     //Cerrar
     sr.Close();            
 
     yield return new WaitForSeconds(0.5f);//Esperamos para estar seguros que escriba el archivo
     
     //Abrimos archivo recien creado
     Application.OpenURL(ruta);
 }

Comment
Add comment · Show 2 · 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 silverxah · Jul 26, 2017 at 09:41 PM 0
Share

many thanks!

avatar image JeyP4 · May 09, 2018 at 09:55 PM 0
Share

Hey @Don-Tako Hey @silverxah

Where we have to place this code? Is it below at the "xxxxxxxx" position?

 using UnityEngine;
 using System.Collections;
 
 public class ExampleClass : $$anonymous$$onoBehaviour
 {
 .....my variables
 
      xxxxxxxxxx
 }
avatar image
0

Answer by MyUnitydream · Sep 12, 2018 at 05:16 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 · Show 1 · 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 Mario-M701 · Dec 10, 2018 at 09:55 PM 0
Share

Does uniExcel supports Android? Thankyou

avatar image
0

Answer by alphadogware · Nov 05, 2019 at 10:07 PM

I am interested in this, but what build formats does it support?

@MyUnitydream

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

68 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

Related Questions

Open C# Project Opens Windows Explorer 0 Answers

My animation is working but the character won't move. 2 Answers

Unity 5+ compatibility with VS2012 - ? 0 Answers

Visual Studio's 'Attach to Unity' replaced with standard 'Attach...' and will not attach to Unity properly 1 Answer

Missing MasterServer.exe 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