LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Inserting new line in an array

I need to insert a line of data into a file
 
These are the steps I am taking
1)read the old file
2)put each line of old file into a single demention array element (248 lines)
3)add one more empty element to array (one more line)
4)shift the last four elements "down" one element <---THIS IS WHERE I AM HAVING PROBLEMS
5)insert new data into element at element 244
6)convert string array in to string
7)write the file
 
I am having trouble juggling the array to insert the new line.
 
 
========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 1 of 4
(3,303 Views)
The "insert into array" block sounds like it might be your ticket.  It is tucked away in the array palette.  Wire in the new line, and your indexes, and it should be kosher.

~milq
0 Kudos
Message 2 of 4
(3,293 Views)
Thanks, but I guess I forgot to mention I am using Labview 5.11 and do not have the Insert into array function.
 
I ditched shifting and inserting into an array all together and went a completly different route.
 
Convert file to array
Split array at element 244 (location where new line is to be added)
Write first half of file to disk
Append the new line to the file
Append the remaining lines to the file
 

Message Edited by RTSLVU on 04-25-2007 11:04 AM

Message Edited by RTSLVU on 04-25-2007 11:07 AM

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 3 of 4
(3,273 Views)
I figured it wasn't going to be that easy 🙂 . . . it never is.

Sounds like you took care of the problem.

Best,
~milq
0 Kudos
Message 4 of 4
(3,258 Views)