LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Insert spreadsheet to top of another spreadsheet

I am trying to do some on-the-go statistical analysis.

I am trying to calculate min,max,avg, std dev for: each of the 15 groupings (see attached VI) and overall

The calculations are working right now...allthough I am sure the way I did it is not the best choice so if anyone has any suggestions feel free.

Anyway, the end goal is to replace the statistical data at the top of the spreadsheet (see attached) with the newly calculated statistical data.

If I open the original and delete the first 10 rows of the 2D array, then insert the new data and save it, I loose either the numerical values or the text due to format issues.


The attached VI does not work properly, as it saves teh new statistical data to the top but it does not delete the old statistical data. Also, the spreadsheet size increases by 1 row each test. Files get very large in size.


Any help will be greatly appreciated.

Thanks,
Ryan

Message Edited by esa_paranoid on 06-09-2005 11:50 AM

Ryan

LV 7.1
0 Kudos
Message 1 of 10
(3,671 Views)
Original Spreadsheet
Ryan

LV 7.1
0 Kudos
Message 2 of 10
(3,669 Views)
Anyone have some ideas?
Ryan

LV 7.1
0 Kudos
Message 3 of 10
(3,658 Views)
The reason that your VI is currently not working is that you are essentially just concatenating the two files, which makes the result file grow as you described. I do understand the dilemma that you explained about deleting the first 10 rows, and it is really nothing more than a datatype issue. It sounds like you were trying to read the data as numbers when many of the cells are strings.

The easiest way to fix your VI was to simply insert a Search/Split String.vi before overwriting the file of interest. What this VI does is search for a particular string and splits the string into two pieces. Since I assumed that the only part of the file that you wanted to preserve was the portion that started with the "Date" cell (and since "Date" doesn't occur anywhere else in the file), I just searched the string for "Date" and only appended the portion thereafter. I've attached the fix.

I know this wasn't the clearest explanation, so if you have any further questions about it, feel free to post them.

Regards,

Message Edited by AESulzer on 06-10-2005 05:57 PM

E. Sulzer
Applications Engineer
National Instruments
0 Kudos
Message 4 of 10
(3,650 Views)
Thank you for the response, your explanation is more than clear, it makes perfect sense and will work great.

Prior to receiving this response I had "solved" the dilema in the following fashion...allthough it seems VERY redundant.

I did everything the same as the posted VI, but when the "temp" file was created, I would read the string length and store this value. So basically...when the VI runs, I created a temp file with the updated statistics, I then read the "stored string length" and delete that many characters from the main file, then concatenate the two. Of course the string length is then updated.

This works, however when the file size gets large it becomes a burden on the PC (around 15,000 lines in the spreadsheet is when things start to get bogged down).

Thanks a lot for the response, I will give it a shot!

Ryan
Ryan

LV 7.1
0 Kudos
Message 5 of 10
(3,639 Views)
AE, I cannot open your VI as I have 7.0

If you get a chance to repost it I would appreciate it, however am pretty sure I know what you are saying.

Thanks,
Ryan
Ryan

LV 7.1
0 Kudos
Message 6 of 10
(3,637 Views)
My apologies for the wrong version!
Here's a copy in 7.0 if you still need it.

Regards,
E. Sulzer
Applications Engineer
National Instruments
0 Kudos
Message 7 of 10
(3,631 Views)
HI
is there a reason why I can't see the code when I open it ?
0 Kudos
Message 8 of 10
(3,343 Views)
Untitled_fix.vi is a LV 7.0 version and I can open it with LV 7.1.1 without problems. The code is in the block diagram and I can see it. the only confusing thing is that no front panel objects are needed.
Waldemar

Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
0 Kudos
Message 9 of 10
(3,326 Views)

Oupsss Smiley Surprised

thx

0 Kudos
Message 10 of 10
(3,323 Views)