 Fonzie1104
		
			Fonzie1104
		
		
		
		
		
		
		
		
	
			08-11-2010 03:40 PM
Hey guys,
I have an array of numbers with roughly 250,000 lines. I want to give the user the ability to delete every nth line depending on the user choice. The program that I have developed and attached takes nearly an hour. Is there a faster way to execute this?
There are a few random indicator in there so I can see interations vs. amount of lines.
Solved! Go to Solution.
 altenbach
		
			altenbach
		
		
		 
		
		
		
		
		
	
			08-11-2010 04:04 PM
Yes, operate in place. Please attach your actual VI with some typical data instead of an image.
Delete from array must create a new copy in memory, moving all higher elements down one slot. Very inefficient!
08-12-2010 08:51 AM
Both VI and the data to be used is attached. The data file is only a portion of it because the original file is too large to post
 smercurio_fc
		
			smercurio_fc
		
		
		
		
		
		
		
		
	
			08-12-2010 09:16 AM - edited 08-12-2010 09:16 AM
Perhaps you can simply adapt this example from the one and only ... http://forums.ni.com/t5/LabVIEW/deleting-data-from-array/m-p/916956#M412811
 altenbach
		
			altenbach
		
		
		 
		
		
		
		
		
	
			08-12-2010 11:50 AM - edited 08-12-2010 11:52 AM
@Fonzie1104 wrote:
Both VI and the data to be used is attached.
Please don't use weird characters in file names....
Try this. (Attached VI is in LabVIEW 8.6). See if it is any faster. 😄
Modify as needed.
 altenbach
		
			altenbach
		
		
		 
		
		
		
		
		
	
			08-12-2010 02:10 PM
Soo... how much faster was it on the full array. 😄
(BTW: if you have huge datasets, I would not send them all to a gigantic indicator. Maybe write them back to a file or only display a subset, for example.)
08-13-2010 07:50 AM
I actually have it being written to a file. I was just using the indicator to see if it was working but it was a LOT faster. It's done in less the a min so def. a lot faster than an hour haha. Thanks!
 altenbach
		
			altenbach
		
		
		 
		
		
		
		
		
	
			08-13-2010 08:16 AM - edited 08-13-2010 08:17 AM
Since you are just shuffling entire rows, it might be faster if you just operate on a 1D array, one element per line instead. (Why parse all the row elements separately if we are not interested in the row details??? 🐵
See if it is any faster....

08-13-2010 09:45 AM
It took about the same time. The first way you posted worked the best for me. Thanks again! I have another question. In order to get that data that I am working with, I need to parse rather large files. I have attached a portion of one of the original data files. The thing I am trying to do is parse the data in such a way that I have the date/time in one array (string array), and the data in another array (number array). The data that is attached looks similar to:
date 1, time 1, data 1, date 2, time 2, data 2, date 3, time 3, data 3....
Now when the DAQ takes the 2nd data point (data 2), the first data point (data 1) remains the same so we are trying to parse it to look like:
date 1 time 1 data 1
date 2 time 2 data 1 data 2
date 3 time 3 data 1 data 2 data 3
The time bases are different but we want to keep the previous data that was recorded and show the new point within that row every new date/time. The program I am using again takes hours and hours to complete and I'm sure it's a similar issue as before. I posted this issue before but I thought this technique you just showed me could be used in the same way. I don't have enough experience in LabVIEW to understand how the memory is reacting to my program. I attached my VI but chances are it's way too complicated for you to follow but it works (I know a lot of it is probably not necessary or some parts are the long way about doing it but I just started LabVIEW this summer) Any input is much appreciated!
I was trying to develop a new program to determine if a number in the string is a time or data point. Then it would send it to its appropriate array. I couldn't get anything to execute properly.
08-13-2010 09:48 AM
I attached one of the output files that we were getting. This is a string but we are looking to get it into the two seperate array files. The first with date/time and the other with the raw data.