LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

delete section of text and put in array

Hello,

 

Forewarning: I'm a LabView novice and still learning the ins and outs.

 

I'm having trouble deleting a portion of text from a .txt file and imputing that section into an array. I have set up my vi with a for loop with shift registers wired into delete from array, with the loop iteration plus the line I want my vi to start at attached to the index. The deleted portion is being wired to an array and the cycle continues. My array is coming up with every other line of the text that I want, which I suspect is because of the shift registers...any help would be greatly appreciated!

 

0 Kudos
Message 1 of 4
(1,540 Views)

I suspect you want to delete rows 15-21 and have those in a new array? If only there were a way to specify a length to delete from an array..... you might be able to do this all without a for loop.

 

Spoiler
There is!

Wire a 7 to the length, 15 to the row index and get rid of the for loop.
0 Kudos
Message 2 of 4
(1,523 Views)

Ah! I always want to make things so much more complicated than they need to be. 
Thank you so much! 

0 Kudos
Message 3 of 4
(1,496 Views)

Since you only want the selected portion and don't care about the rest, the correct function is "array subset".

 

("Delete from array" is only appropriate if you want both at the end: (1) the deleted portion and (2) the original array with the subset deleted.!)

0 Kudos
Message 4 of 4
(1,464 Views)