LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Loading from txt file

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

0 Kudos
Message 1 of 13
(3,766 Views)

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.

0 Kudos
Message 2 of 13
(3,765 Views)

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?

0 Kudos
Message 3 of 13
(3,763 Views)

Read into an Array and then use the Decimate Array function.

Message 4 of 13
(3,758 Views)

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

0 Kudos
Message 5 of 13
(3,757 Views)

maybe the count connector in

Read from Text File Function

Owning Palette: File I/O VIs and Functions

Requires: Base Package

could help?


 

0 Kudos
Message 6 of 13
(3,746 Views)

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.

0 Kudos
Message 7 of 13
(3,732 Views)

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.

Message 8 of 13
(3,723 Views)

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

0 Kudos
Message 9 of 13
(3,718 Views)

What kind of output do you want, the same kind of text file containing every fourth measurement? Four arrays containing every fourth measurement of each dataset?

 

Ben64

0 Kudos
Message 10 of 13
(3,709 Views)