This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Having my CCS program C-Code read values from an Excel Spreadsheet?

Other Parts Discussed in Thread: MSP430F2619

Hello All,

I have been tasked with need to grab variables from an excel spreadsheet that will fill variables in my C Code.

This will transfer to my MSP430F2619. I am using Windows

Is there a simple way to do this? Maybe a tutorial to show me how to turn my .CSV into usable variables in my code?

I saw this:

const unsigned in table[]={

#include "table.csv"

};

Is there a way to separate the variables?  Like block 1 = variableA, block 5 = variableE  ?

Any more information and advice is greatly welcomed.

Thanks for your time, K

  • Hi,

    As you can imagine, in order to make the #include you mentioned work you need to make sure your CSV file matches whatever C expects as values.

    We don't have anything like that built into our tools. However, since this is a problem mostly related to the C and CSV standards instead of CCS or device specific, searching on the internet yields some suggestions of routines and libraries to perform a CSV --> C parsing. A reference with several replies is shown below:
    stackoverflow.com/.../read-csv-file-in-c

    Hope this helps,
    Rafael