LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Down-sampling (decimate) huge csv data

Solved!
Go to solution

Hi all,

 

I'm trying to down-sample (decimate) the attached csv data, hopefuly I can build a decimator to take values from the csv file (input) every certain number of rows and transfer them into a new excel file (output). Any suggestions?

 

Thanks.

0 Kudos
Message 1 of 10
(11,109 Views)

Labview do have such functions as from Labview 8.2

Decimate (single shot) VI or Decimate (continuous) VI
Owning Palette: Signal Operation VIs
Installed With: Full Development System

I would recommend to use the avaraging option as this can smooth out the signal



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 2 of 10
(11,093 Views)

Is it possible to decimate more than one column from the excel file? Could someone post an example on how to call data from different columns in an excel file?

 

Thanks.

0 Kudos
Message 3 of 10
(11,077 Views)
Solution
Accepted by topic author cRIO+FPGA Apps

If you have your data open in Excel, you may choose to save as 'Tab Delimited Text.' This will allow you to directly interact with the Read From Spreadsheet VI pictured here:

 

Read from spreadsheet.jpg

 

Reading in all rows of data will allow you to manipulate the data to extract individual columns using the array functions in LabVIEW. i would reccomend consulting the LabVIEW Help for instruction on File I/O, as well as Array manipulation. 

 

Cheers,

 

Patrick Corcoran
Application Engineering Specialist | Control
National Instruments

0 Kudos
Message 4 of 10
(11,060 Views)

Could you please provide with an example or something related on how to call a column from an excel data sheet to be use with the "decimator" vi?

 

Thank you!

0 Kudos
Message 5 of 10
(11,025 Views)

You may try the http://www.ni.com search in the upper right corner, for the term "Parse CSV." You should find something related.

 

Cheers!

Patrick Corcoran
Application Engineering Specialist | Control
National Instruments

0 Kudos
Message 6 of 10
(11,015 Views)

Thanks, I have something going on (see attached) ... it works perfectly, however, there are some features I would like to add,

 

1. Having predefined column titles for the ouput file (excel).

2. Automatically opening the output file at the end.

 

Any pointers?

 

Thanks again.

0 Kudos
Message 7 of 10
(11,013 Views)

Looks like a great start! I believe adding a second Write to spreadsheet will allow you to define your Headings. See Blow:

 

Modified.jpg

 

With regard to opening the file after execution, if you were hoping to specifically invoke Microsoft Excel for data viewing, you would now be venturing into Active X territory. You may want to examine the functions of the LabVIEW Report Generation Toolkit. An example of invoking the launch of an Excel report is given here:

 

Open or Create Excel Report

http://decibel.ni.com/content/docs/DOC-3546

 

Best,

Patrick Corcoran
Application Engineering Specialist | Control
National Instruments

Message 8 of 10
(11,007 Views)

Thanks a lot PCorcs!

 

How could I clean the output file? i.e. the output file shows empty cells (with "0") from column K until column S (I'm only using columns A to J), how could I get rid off those?

 

Thanks!

0 Kudos
Message 9 of 10
(10,971 Views)

I believe it has to do with the initialization of your array, as full data set. If you create an indicator on the decimated array, can you verify that the points removed have been replaced with 0, yet the array size remains the same?

 

You may need to use an 'Array Subset' function on the array palette to trim the 0s off of the decimated data set, before writing to the spreadsheet.

 

Hope this helps,

 

 

Message Edited by Pcorcs on 03-11-2010 09:33 AM

Patrick Corcoran
Application Engineering Specialist | Control
National Instruments

0 Kudos
Message 10 of 10
(10,940 Views)