Jump to content

Creating a new Array from existing Array using _ArrayAdd and _ArrayInsert


Go to solution Solved by Gianni,

Recommended Posts

Hey folks,
 
I am trying to create a new array from an existing array by adding/inserting values from the existing 20 column 2D array into a new 2 column 2D array if the row/column cell contains a value.
 
My thought was that I could use _ArrayAdd to add the first column into the new array, and then _ArrayInsert to insert data into the second column in the same row. The script that I have written is not inserting the data into the second column of the new array.
 
local $y
_FileReadToArray("students.csv",$aArray,0,",")
Local $aArray2[0][2]
for $x = 1 to ubound($aArray)-1
   if StringLen($aArray[$x][22]) Then
      $y += 1
      _ArrayAdd($aArray2, $aArray[$x][11], 0)
          _ArrayInsert($aArray2, $y, $aArray[$x][22],1)
   EndIf
Next

 

Your help is appreciated. Thank you.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...