03-22-2021 08:35 AM
Hey ! I'm strugling a bit with my Labview project right now. I have to read excel files from a folder and make some analyses from the datas into those files. Does anyone know how to do that ?
03-22-2021 10:26 AM
@Skratshi wrote:
Does anyone know how to do that ?
Yes.
What part is giving you problems? (Getting all excel files from a folder? reading the excel files? Analyzing the data? Saving the results? etc.)
03-22-2021 08:06 PM
An important question is what you mean by "Excel file". Is this a file with the extension .xls or .xlsx, an extension signifying an extension specific to the proprietary Microsoft Excel™ program, or a plain Text file, dividing into rows of text, with columns defined either by a comma character or by a <tab> character, sometimes with the extension ".csv" (which stands for "Comma-separated Values"?
LabVIEW provides the "Read Delimited Spreadsheet" function for .csv files, which (as they are ordinary Text files) can be also read with other LabVIEW File I/O functions and parsed using the LabVIEW String functions (including Spreadsheet to Array).
If the file is a native Excel file (.xls, .xlsx), it can be read and parsed by functions in the Report Generation Toolkit. There are also third-party tools that can handle the proprietary .xls/.xlsx format.
Bob Schor
03-25-2021 08:42 AM
The main problem is we have to take some excel files to create a bigger one to read the data in this one to use them in the next part of the code
03-25-2021 09:46 AM
@Skratshi wrote:
The main problem is we have to take some excel files to create a bigger one to read the data in this one to use them in the next part of the code
Command window:
Copy [File1] [File2] ... [FileN] [DestinationFile]
03-25-2021 09:55 AM
@Skratshi wrote:
The main problem is we have to take some excel files to create a bigger one to read the data in this one to use them in the next part of the code
I am going to assume that English is not your native language. That's OK your English is almost certainly better than my Russian. You do have to help us out though. Post attached examples of the files. ICO, input, conversion, output.
03-25-2021 11:05 AM
No english isn't ùy native language lmao!
I attached the excel file that we want to read and analyse. We would like to make measurements of the delta t of pressing buttons. After that plot some graph to see a normal curve.
03-25-2021 12:18 PM - edited 03-25-2021 12:21 PM
Hi Skratchi,
@Skratshi wrote:
I attached the excel file that we want to read and analyse.
That is no "Excel file", it's a simple (delimited) text file!
@Skratshi wrote:
We would like to make measurements of the delta t of pressing buttons. After that plot some graph to see a normal curve.
Which buttons are to be pressed?
Your VI is overly complicated! You really need to cleanup before implementing serious improvements!
Example:
The FOR loop at the bottom of the second frame can be simplified to this little code snippet:
Yes, that's all that is needed here!
The same applies to all that duplicated code to calculate all those histogram graph: use an autoindexing FOR loop to repeat the same code.
And what's the point of that FOR loop in the 1st frame, which iterates 2359 times?
03-29-2021 01:55 PM
@GerdW wrote:
The FOR loop at the bottom of the second frame can be simplified to this little code snippet:
Yes, that's all that is needed here!
Not quite. Since they hammer the memory manager by prepending the new element to the existing array (instead of appending), You would need to insert a "reverse array" at the end..
03-29-2021 03:05 PM
Hi Christian,
@altenbach wrote:
@GerdW wrote:
The FOR loop at the bottom of the second frame can be simplified to this little code snippet:
Yes, that's all that is needed here!
Not quite. Since they hammer the memory manager by prepending the new element to the existing array (instead of appending), You would need to insert a "reverse array" at the end..
Well, right now they calculate a histogram and the min/max: no need for array reversal…