I have two tables each originating from seperate SQL-queries. The first one E has 7 columns and the second S has 3. The first column is the identifier. I want to include the values from S into E so that I can run an alogrithm for each row and export all values in one csv.
With now 2600 rows the matching takes ~4-5 minutes. Is there a more efficient way to do this? I want to be able to run the script very regularly and for more than 10,000 entries.
foreach($row in $E){
$ID = $row.ID
$mS = $S | ?{ $_.ID -match ("^"+$ID+"$")}
$value1 = $mS.value1
$value2 = $mS.value2
$row.value1 = $value1
$row.value2 = $value2
}