Hopefully this is the correct location to post this. I am trying to read the second, third and fourth column of the data file in excel and determine the min and max of each column. I keep getting 0 as a value, due to the fact when there is no data in the array it is reading as 0, any help on how to either program that zero is not an acceptable answer or how to make it stop reading after there is no more data would be helpful. I am new at this so any explanation would be great, I attached the data file and my program thus far.
Solved! Go to Solution.
First, let's correct your message subject. You are reading data from a text file. There is nothing here that has to do with an Excel file.
Because your data has a row of headers, when you use Read from Spreadsheet file, it is trying to intepret that has data, and since it is just text, it is being converted to zeroes.
I would use Array subset or Delete from Array to elminate the first row of data, then use your functions on the remaining array.
The Read From Spreadsheet VI will read *all* the rows including your header row.
That row is giving you a row of 0.
Any row without numbers also gets converted to 0 this includes blanks.
I used the subset array, but the minmum data is still being recorded as 0.
Used it how??? You need to ignore the part that is text. Put down some extra indicators and work with the subset array and be SURE you are removing the part you think you are.
P.S.: Delete from Array is really a better choice for this task (IMHO) but you should be able to use either.
I used it by applying it to the read from file and instead of all rows I attached the subset. I guess what I am getting confused with is how to further modify it when adding the delete array or something like that.
Well you already got it! You just have to tell Delete from Array which row to remove. If you hover over the VI connections with the wiring tool (spool) you will see it says Length, Row and Column. You want to remove row #0 so.....
EDIT: Also don't forget to have the Context Help window open (cntl-h). It will guide you on what the possible connections are.
I just noticed that your minimums are still zero. You must have some crap at the end of your file. Delete from array can still work here but now Array Subset is the better choice. You need to cut off the first row (so first index = 1), then keep only the next 29 rows since that's all the data in your CSV table.
Again, set up some extra indicators and run your VI many times with different numbers for index, length, etc. Play around and learn what the array VIs can do.