Jump to content

Extract EXCEL sheet contents into 2D array.


Recommended Posts

Hi,

I'm having a excel database with me. The excel sheet contains different data types.

Column A consists of seriall Number (Integer), Column B consists of instrument description (Strings), Column C consists of model Number (Number with special characters), Column D consists of instrument Calibration date (Date), Column E consists of instrument Calibration due date and so on......

What i want to do is that i need to extract the excel sheet's content in to 2D array.

And using array functions i want to compare the date and accordingly i want to do some calibration alert system.

the questions is how i can make a 2D array from a excel sheet consists of different data types?

any help?

thanks

Link to post
Share on other sites

Just be aware that the spreadsheet to array functions will work if you save to a csv or tab delimted file from excel, but the XLS or XLSX files are harder to get into LabVIEW because they have to come in through automation of office rather than acting on them directly (unless there are some third party tools out there for it now).

Cheers,

James

Link to post
Share on other sites
  • 3 months later...

In an array the datatypes are always the same type.

You could read the spreadsheet as strings and at the time you want to do comparisons convert the string to the type you want

You can read data using spreadsheet VI. but is is difficult to convert time stamp data into labview format.

For this you can try follwing link. It will also help you to read data from excel.

https://decibel.ni.com/content/docs/DOC-16911

https://decibel.ni.com/content/docs/DOC-16911

Regards

Prabhakant

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Similar Content

    • By Porter
      This package contains VIs for reading and writing to CSV files that follow the CSV format outlined in RFC-4180 (see http://tools.ietf.org/html/rfc4180). Using this package, you can properly import CSV files that were exported from spreadsheet programs such as Microsoft Excel, Open Office or LibreOffice Calc as well as export CSV files that will be compatible with any program capable of interpreting CSV files.
       
      This implementation of the CSV format is capable of handling escaped fields such as those containing commas (or other field delimiters), multiple lines, and double quotes.
       
      Notes:
      - Starting from V1.1.0, library files are located in "<LabVIEW>\vi.lib\LAVA\Robust CSV" and example is located in "<LabVIEW>\examples\LAVA\Robust CSV".
      Development version available on GitHub: https://github.com/rfporter/Robust-CSV
    • By Porter
      View File Robust CSV
      This package contains VIs for reading and writing to CSV files that follow the CSV format outlined in RFC-4180 (see http://tools.ietf.org/html/rfc4180). Using this package, you can properly import CSV files that were exported from spreadsheet programs such as Microsoft Excel, Open Office or LibreOffice Calc as well as export CSV files that will be compatible with any program capable of interpreting CSV files.
       
      This implementation of the CSV format is capable of handling escaped fields such as those containing commas (or other field delimiters), multiple lines, and double quotes.
       
      Notes:
      - Starting from V1.1.0, library files are located in "<LabVIEW>\vi.lib\LAVA\Robust CSV" and example is located in "<LabVIEW>\examples\LAVA\Robust CSV".
      Development version available on GitHub: https://github.com/rfporter/Robust-CSV
      Submitter Porter Submitted 02/21/2014 Category Database & File IO LabVIEW Version 8.6 License Type BSD (Most common)  
    • By Aishwarya Saravanan
      My project involves designing a front end for a synchronous generator using LabVIEW.   It is actually data acquisition and display of signals in a file.   The problem I face when building a program is that:   1)the sampling rate is set to 100 samples with 1 kHz sampling frequency.These signals are generated by daq assistant and i have used merge signals to merge these signals from daq assistant as well  as signals from other radio buttons and Boolean as well. The problem is that when written on a file I am able to see only one instance of Boolean status for every 100 samples daq assistant creates.   2) now iam able to write only 0/1 as status of Boolean in the file.How will I write on /off into file?

    • By torekp
      So I created a DLL from a Labview VI that has a 2D array input (and some scalar inputs) and some 2D array outputs.  Labview creates a .h file with these lines

      And then it defines the 2D array arguments to my function as being of this type: "void __cdecl Linear_discrim_4dll(DoubleArray *dataObsFeat, int32_t grpAsz," etc etc.  Trouble is, I have no idea how to fill out this structure so that the DLL can use it.  Say for simplicity I had a 2 by 3 input called dataObsFeat with elements {1,2,3; 11,12,13}; how would I create the object with these values in C or C++ and pass it to the function?  I am a total C++ noob, in case it isn't obvious.
    • By Gab
      Hello,
      Is it possble to put signatureline into excel footer using Active X ?
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.