Author Topic: Insert data from one array into another  (Read 247 times)

1bosborn

  • Newbie
  • *
  • Posts: 14
Insert data from one array into another
« on: June 25, 2021, 12:56:24 pm »
I am working on a project where I want to see if data from one two dimensional array exists in a second array, and if so insert the entire row into a third array. It's been rolling around in my head as possibly some custom function using ArrayInsert on the target and a For/Next loop to get the values from the source array and assign the values to the inserted row in the target. I just thought I would ask if there is a built-in function I am missing before I tried to build something custom. Thanks as always for your wisdom.

td

  • Tech Support
  • *****
  • Posts: 3952
    • WinBatch
Re: Insert data from one array into another
« Reply #1 on: June 25, 2021, 01:18:51 pm »
There are several ways to approach your task but there is no one function that does it for you. So you will have to create something. Here is a link to a list of WIL array functions:

https://docs.winbatch.com/mergedProjects/WindowsInterfaceLanguage/html/ArrayHandling.htm

Staring at the list may help you imagine a clever solution.

One suggestion is to sort your rank 2 (two-dimensions) array(s). That will make searching quicker.

"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

JTaylor

  • Pundit
  • *****
  • Posts: 1743
    • Data & Stuff Inc.
Re: Insert data from one array into another
« Reply #2 on: June 25, 2021, 02:41:17 pm »
You might also consider the Omnibus Extender and its SQLite capabilities.  Depending on what you are doing it you might find it an attractive alternative.

Jim

stanl

  • Pundit
  • *****
  • Posts: 1573
Re: Insert data from one array into another
« Reply #3 on: June 26, 2021, 02:40:42 am »
You might also consider the Omnibus Extender and its SQLite capabilities.  Depending on what you are doing it you might find it an attractive alternative.

Jim


I agree with Jim's suggestion, especially if your arrays could be considered row,column assignments.


[EDIT] of course, this could turn out to be another 'homework'.....