03-20-2018 04:30 AM
I am trying to insert a single element into a 2D array but nothing seems to happen. What i am trying is to first index the required row of the 2D array and then write the new element to the end of that row. Then insert that modified array into the original 2D array ... so whats wrong and how to go about this ?
Solved! Go to Solution.
03-20-2018 07:11 AM - edited 03-20-2018 07:12 AM
You can't replace a value that is not in the original array. You have to use Build Array or Insert Into Array to add an entire column all at once.
03-20-2018 05:32 PM
Use this.
03-21-2018 04:31 AM
@paul_cardinale wrote:
Use this.
What is a VIM file ? Can you send a VI snippet ? Thanks
03-21-2018 05:12 AM
@MogaRaghu wrote:
What is a VIM file ? Can you send a VI snippet ? Thanks
It is a Malleable VI, but that is new to LabVIEW 2017. The VIM will autoadapt the inputs to whatever you wire up to them. A very powerful tool.
03-21-2018 05:25 AM
Yeah i read about it after i saw the post...
Anyway i have LV15 only and as such can do nothing with it unless it is saved as a snippet for LV15.
03-21-2018 07:07 AM
Here's a non-maleable (string only) version in LV 2015
03-28-2018 02:47 AM
@paul_cardinale wrote:
Here's a non-maleable (string only) version in LV 2015
Thanks . This is good for a single dimension array.
But i need to be able to manipulate a 2-D array. Let me explain :
1. User creates in Excel a CSV file that has 6 columns and N rows. ( The rows will depend on the specific plan data ). We will call this PLAN.CSV
2. I read this PLAN.CSV and take up each row and do something with that data. After the job is complete i need to be able to append three additional columns to that Row with Date / Time / Status string. This needs to be done for all the rows and once complete its called ACTUAL.CSV
3. To be able to do the above, i should initially take the PLAN.CSV and create three additional empty columns and call that file ACTUAL.CSV. As and when data becomes available i can then fill in element by element into the empty columns.
How to programmatically do the above ? .
03-28-2018 02:55 AM - edited 03-28-2018 02:57 AM
Hi Moga,
3. To be able to do the above, i should initially take the PLAN.CSV and create three additional empty columns and call that file ACTUAL.CSV. As and when data becomes available i can then fill in element by element into the empty columns.
How to programmatically do the above ? .
1. You get a 2D array from your CSV file. Determine the column length ("how many rows has this array?")
2. init a "3 columns × rowsize" 2D array of empty strings (InitArray) and append it to your initial CSV array.
Finished:
03-28-2018 06:23 AM