LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

delete columns in excel

I have a file that is outputted from LV, it looks like this:
 
2008-01-25;12:47
Relative Time;S1;S2;S3;S4;S5;S6;S7;S8;;;;;;;;;;;;;;;;;;;;;;;;
00:00:00;-0,077;0,117;-0,016;-0,049;-0,000;-0,067;-0,254;-0,406;0,000;0,000;0,000;0,000;0,000;0,000;0,000;0,000;0,000;0,000;0,000;0,000;0,000;0,000;0,000;0,000;0,000;0,000;0,000;0,000;0,000;0,000;0,000;0,000
00:00:01;-0,077;0,117;-0,016;-0,049;-0,000;-0,067;-0,254;-0,406;0,000;0,000;0,000;0,000;0,000;0,000;0,000;0,000;0,000;0,000;0,000;0,000;0,000;0,000;0,000;0,000;0,000;0,000;0,000;0,000;0,000;0,000;0,000;0,000;blahblah
 
(0-4 columns with timestamps, this varys from time to time, but that info is avaliable in a bool array, and then 32 measurements followed sometimes by a comment)
 
I also have an array in LV with booleans that have information on those channels I want (32 total).
 
Right now I import the entire file into excel using a slightly modivied version(semicolon instead of comma) of reading a CVSfile into excel (from NI online examples).
 
but the question is, what would be the better solution,
1) to first read the file into LV, and there filter out then cahnnels I want, write it back and open it in excel or
2) read the full file into excel and by using my boolean arrays, delete my unwanted columns and shift the rest.
 
the first option I could do myself, but it feels kinda "cheap", but I have no idea on howto do the second, so either a pointer on where to find that info or an image that shows the proper nodes/properties to use.
 
Anders
0 Kudos
Message 1 of 5
(3,126 Views)

Hi anders

i think the first way is better, because the function to select the useful data is in your program and if you ever change your output format the selection is still existing.

Mike

0 Kudos
Message 2 of 5
(3,110 Views)

Okay, seems like I ran into some trouble...

I thought all I had to do was to read it back in with read from spreadsheet file, but all my timestamps were then gone.

Below are some screenshots, all I did was to read it with read to spreadsheet VI with file input and semicolon as separator, and then selected subarrays and formatted them as they were saved. (see excel import), but all I get i jibberish. Suggestions?




Message Edited by Tohatsu on 01-28-2008 08:40 AM
Download All
0 Kudos
Message 3 of 5
(3,087 Views)
Posting an image of the front panel of the VI doesn't provide much information. You should at least post an image of your block diagram and the best thing to do would be to post a data file and the actual VI. I suspce that all you have to do is use the Read From Spreadsheet File in string mode instead of dbl. Not sure why you would want to use a semicolon as a separator thoug. That would allow you to import the times (hours, minutes, seconds) into separate columns but the rest of the data would be incorrect.
0 Kudos
Message 4 of 5
(3,078 Views)

reading them as string worked excellent, since I dont have to interpret the data, but only filter out the unwanted parts, it made my day 😄

On the semicolon part, there are several reasons:

1) Semicolon is not used anywhere in the data

2) to avoid the problem with some having comma as decimal separator and some having dot (user speciffic settings)

3) to make the file readable "to the eye" as a long sensorname would shift everything one column if I used tab separator.

 

oh, and time-values are not separated by semicolon, it's separated by colon.

But thankyou for the good solution!

Anders

0 Kudos
Message 5 of 5
(3,041 Views)