#include <SQLite.au3>
#include <SQLite.dll.au3>
$file=FileRead(@ScriptDir&'\1.txt')
$str=StringRegExp($file,'[^;:\r\n]+',3)
$file=0
Local $aResults, $iRows, $iColumns
_SQLite_Startup()
Select
Case @error
MsgBox(32, '', 'невозможно работать с db')
Exit 1111
EndSelect
$hDb_mem = _SQLite_Open()
_SQLite_Exec($hDb_mem, 'create table if not exists t1 (a,b,c text);')
_SQLite_Exec($hDb_mem, 'create table if not exists t2 (a,b,c text);')
$zzz=''
For $i = 0 To UBound($str)-1 Step 3
$zzz&='insert into t1 values ("' & $str[$i] & '","' & $str[$i+1] & '","' & $str[$i+2]& '");'
Next
$str=0
$file=FileRead(@ScriptDir&'\2.txt')
$str1=StringRegExp($file,'[^;:\r\n]+',3)
For $i = 0 To UBound($str1)-1 Step 3
$zzz&='insert into t2 values ("' & $str1[$i] & '","' & $str1[$i+1] & '","' & $str1[$i+2]& '");'
Next
$str1=0
$file=0
_SQLite_Exec($hDb_mem, "begin;")
_SQLite_Exec($hDb_mem, $zzz)
_SQLite_Exec($hDb_mem, "commit;")
_SQLite_GetTable2d($hDb_mem, 'select t1.a,t2.c from t1,t2 where t1.b=t2.a and t1.c=t2.b;', $aResults, $iRows, $iColumns)
$zzz=''
For $i = 1 To UBound($aResults)-1
$zzz&=$aResults[$i][0]&':'&$aResults[$i][1]& @CRLF
Next
$aResults=0
_SQLite_Exec($hDb_mem, 'drop table if exists t1;')
_SQLite_Exec($hDb_mem, 'drop table if exists t2;')
FileWrite(@ScriptDir&'\result.txt',$zzz)
$zzz=''
_SQLite_Close($hDb_mem)
_SQLite_Shutdown()