04-13-2012 08:07 AM
Hello!
I am loading some data from a txt file, containing measurements. If I don't want to load all the measurements but only some of them, lets say every 4th or 5th, is there a good/simple solution for doing this?:)
Greetings
Kristoffer
04-13-2012 08:10 AM
Just curious. Why don't you want to load all of the measurements?
You'll have to read in the entire file anyway so I'd recommend reading the file and then filtering to only use the data you want.
04-13-2012 08:15 AM
Maybe not a good explanation from me there! If i filer when loading or load and then filter should not matter, but how to filer out like 4/5 maeaurements?
04-13-2012 08:19 AM
Read into an Array and then use the Decimate Array function.
04-13-2012 08:21 AM
Sjefsgjogleren,
1. Please attach an example measurement file. Knowing the format of this file is key for filtering.
2. What is the logic behind your "4 or 5 measurements (how are you deciding)"? This is also key for determining the process.
When we know these 2 things we can begin to help you.
-Chazzzmd
04-13-2012 09:10 AM
Owning Palette: File I/O VIs and Functions
Requires: Base Package
could help?
04-13-2012 09:44 AM
1. I have done that now.
2. The logic is to reduce number of datameasurements, as I can not use all of them in the calculations. If I will have to use every 4th, every 5th or what is still to be found out.
04-13-2012 09:50 AM
Can you describe your dataset?
It looks like you have 4 datasets in the sample file. Each one with a timestamp and a measurement.
Is that correct or is it a single dataset?
Once you've read the dataset, Decimate Array should allow to pull out every 4th or 5th or whatever measurement into a new array.
04-13-2012 09:59 AM
You are correct, it is 4 different datasets inside the file. Each of the dataset has a timestamp and a corresponding measurement. But, to get i.e. every 4th, would you just use the decimate array twice, or is there a more clever solution?
Greetings
Kristoffer
04-13-2012 10:15 AM