05-12-2020 02:12 PM
Alright so this might be a bit confusing, I'm trying to avoid using python but I may not have a choice here.
To give some background this is for logging test shots at a ballistics facility and I need a count of how many of each projectile was shot, amount of powder used for each type of propellant.
I have user inputs being saved to a CSV every time they click the save button.
At the end of the day, they have to have a total count for resources used in testing (which is what is recorded each time the save button is pressed).
So I want to create a case where they can press a calculate button and it will filter through the CSV and only extract the rows of data for that day.
I've already cut the date-time stamp down to just the day I'm just not sure how to go through and get the rows based on that.
Once I get that it needs to be filtered more based on other things, but whatever I do to filter based on the date I'll do that on each subset of data.
05-12-2020 02:22 PM
Post your code so we can help guide you through the rest of what you are trying to accomplish. It is hard to tell you what to do without seeing how you did it. Having a file similar to what you are trying to filter would also be a great idea.
05-12-2020 02:24 PM
I started writing the python script so I don't have any code written for this particular case yet. I can post what I have. Can I upload a VI? or can it be a screenshot?
05-12-2020 02:30 PM
Code is usually better. To open a file in LabVIEW is very easy. Look at the example files to see how to do this. Make a vi that will open your data and display it in an indicator. Do you have a data file that you can share?
05-12-2020 02:51 PM
I attached the main.vi, you shouldn't need the other vi to run it.
05-12-2020 03:01 PM
Not sure, but maybe you're looking for something like this:
05-12-2020 03:03 PM
What format is the date time in? 49:50.1 is not something I am familiar with. Once you get a common format for your data I would simply use an in range vi to check if the dates are within a the min and max for the date. If it is add it to an array if not don't.
Next step would be to figure out which fields (columns) you want to sum and report that how ever you want to.
See the picture for a hint.
You would pass your array of data to this and then sum the fields if they are in range.
05-12-2020 03:28 PM
The only issue with that is, the data is stored as a string in a CSV. Would you use a regular expression to parse the cell (row of data) if so then how do you select the rows once it matches up?
05-13-2020 02:15 AM