filyaxxxcom писал(а): Может и из IC можно пачками писать C IC можно всё. ------------ Дoбавленo в 17.37:Если ничего не напартачил, то как-то так: Add(MultiElementEx,5074999,217,283) { } BEGIN_SDK Add(EditMultiEx,15334202,7,35) { WorkCount=#8:doEvent1| EventCount=#5:onLog| DataCount=#15:NewFileNameLog1|15:NewFileNameLog2|12:FileNameLog1|12:FileNameLog2| Width=522 Height=417 VOffset=126 link(doEvent1,4151595:doEvent1,[]) } Add(Hub,722432,77,175) { InCount=2 OutCount=3 link(onEvent1,4925059:doWork1,[(289,181)]) link(onEvent2,8651700:doRead,[]) link(onEvent3,12212584:doEvent1,[(143,195)(143,349)]) } Add(DSC_Exec,14134642,308,245) { DSManager="parent.main_SQLite" link(onExec,4925059:doWork3,[(352,251)(352,237)(289,237)]) link(onError,7458071:doMessage,[]) link(SQL,4932360:Text,[]) } Add(GetIndexData,10918588,154,56) { Count=3 link(onIndex,6710656:doValue,[]) link(Data2,15334202:FileNameLog1,[(167,51)(27,51)]) link(Data3,15334202:FileNameLog2,[(174,44)(34,44)]) } Add(ChanelToIndex,5659684,70,56) { Count=3 link(onIndex,10918588:doIndex,[]) } Add(Memory,6710656,210,56) { @Hint=#19:номер текущего лога| Default=Integer(0) link(onData,6405710:doStrCat,[]) AddHint(53,10,124,13,@Hint) } Add(StrCat,6405710,448,56) { Str1="Write to the database logfile " link(onStrCat,423252:doWork1,[(508,62)]) AddHint(-110,41,150,13,Str1) } Add(Hub,4151595,35,161) { OutCount=6 link(onEvent1,4363217:doData,[(74,167)(74,139)]) link(onEvent2,5659684:doWork2,[(56,174)(56,69)]) link(onEvent3,722432:doEvent1,[]) link(onEvent4,5659684:doWork3,[(63,188)(63,76)]) link(onEvent5,722432:doEvent2,[(71,195)(71,188)]) link(onEvent6,6894590:doWork,[(59,202)(59,244)]) } Add(HubEx,14647768,504,161) { link(onEvent,15334202:onLog,[]) } Add(FormatStr,9303480,238,378) { DataCount=1 Mask="DELETE FROM log%1 WHERE ROWID NOT IN (SELECT MIN(ROWID) FROM log%1 GROUP BY str);\r\nCOMMIT;\r\nVACUUM;" link(onFString,12714911:doExec,[]) link(Str1,4933873:Var3,[(244,348)]) } Add(DSC_Exec,12714911,287,378) { DSManager="parent.main_SQLite" } Add(StrCat,5066163,203,343) { Str1="Delete duplicate string in logfile " link(onStrCat,13088550:In,[]) link(Str2,4933873:Var2,[]) AddHint(-181,52,164,13,Str1) } Add(GetDataEx,6285917,210,126) { link(Data,6710656:Value,[]) } Add(MultiElementEx,6894590,63,238) { @Hint=#17:Анализ лог-файлов| link(onLog,16331606:In,[]) link(FileName,15334202:NewFileNameLog1,[(69,234)(13,234)]) link(FileName1,15334202:NewFileNameLog2,[(76,227)(20,227)]) AddHint(-40,39,113,13,@Hint) } BEGIN_SDK Add(EditMultiEx,7568427,10,38) { WorkCount=#6:doWork|0:| EventCount=#5:onLog|0:| DataCount=#8:FileName|9:FileName1| Width=657 Height=382 link(doWork,15617388:doEvent1,[(36,44)(36,90)]) } Add(DSC_Query,7001664,230,137) { SQL="SELECT str_full FROM log1 WHERE str NOT IN (SELECT str FROM log2);" DSManager="parent.parent.main_SQLite" link(onQuery,6941679:doAdd,[]) } Add(Hub,15617388,55,84) { OutCount=7 link(onEvent1,16589951:doData,[]) link(onEvent2,7001664:doQuery,[(219,97)(219,143)]) link(onEvent3,6941679:doSave,[(210,104)(210,178)]) link(onEvent4,6527761:doData,[(196,111)(196,214)]) link(onEvent5,8082689:doQuery,[(184,118)(184,265)]) link(onEvent6,11826539:doSave,[(168,125)(168,300)]) link(onEvent7,14472595:doData,[(150,132)(150,339)]) } Add(StrList,6941679,279,137) { link(FileName,7568427:FileName,[(292,71)(16,71)]) } Add(DSC_Query,8082689,265,259) { SQL="SELECT str_full FROM log2 WHERE str NOT IN (SELECT str FROM log1);" DSManager="parent.parent.main_SQLite" link(onQuery,11826539:doAdd,[]) } Add(StrList,11826539,314,259) { link(FileName,7568427:FileName1,[(327,61)(23,61)]) } Add(DoData,14472595,420,333) { Data=String(====== Analyze done! ======) link(onEventData,1924002:doWork3,[(465,339)]) AddHint(-3,47,182,13,Data) } Add(DoData,16589951,406,84) { Data=String(Find unique strings in logfile 1) link(onEventData,2135313:doWork2,[]) AddHint(0,42,163,13,Data) } Add(DoData,6527761,413,208) { Data=String(Find unique strings in logfile 2) link(onEventData,1924002:doWork2,[]) AddHint(-2,41,163,13,Data) } Add(HubEx,2135313,461,84) { Angle=3 link(onEvent,7568427:onLog,[(465,44)]) } Add(HubEx,1924002,461,208) { Angle=3 link(onEvent,2135313:doWork3,[]) } END_SDK Add(Message,7458071,357,252) { Caption="Error SQLite!" } Add(GetDataEx,4933873,210,343) { link(Data,6285917:Var2,[]) } Add(Hub,12212584,161,343) { link(onEvent1,5066163:doStrCat,[]) link(onEvent2,9303480:doString,[(196,356)(196,384)]) } Add(HubEx,12044509,504,182) { Angle=3 link(onEvent,14647768:doWork3,[]) } Add(LineBreak,879780,455,182) { Caption="+log" Color=65280 link(Out,12044509:doWork2,[]) Primary=[13088550,-196,161] } Add(InlineCode,8651700,154,182) { @Hint=#17:построчное чтение|18:файла без загрузки|12:его в память| WorkPoints=#6:doRead| EventPoints=#6:onRead|10:onYes10000|5:onEnd| DataPoints=#8:FileName|4:nTab|7:EndCode| Code=#15:unit HiAsmUnit;|0:|9:interface|0:|21:uses kol,Share,Debug;|0:|4:type|28: THiAsmClass = class(TDebug)|10: private|4: |16: Pos:integer;|40: function TestRep(P:integer):boolean;|9: public|37: FileName,nTab,EndCode,onYes10000,|29: onRead, onEnd: THI_Event;|49: Procedure doRead(var _Data:TData;Index:Word);|5: end;|0:|14:implementation|48:function THiAsmClass.TestRep(P:integer):boolean;|5:begin|11: Pos := P;|18: Result := True; |4:end;|0:|29:Procedure THiAsmClass.doRead;|3:var|13: fl:boolean;|14: tab:integer;|16: n,k,i:integer;|14: F: TextFile;|13: fn: string;|19: str,str_f:string;|5:begin|48: n:=toIntegerEvent(EndCode); // размер кодов|54: tab:=toIntegerEvent(nTab); // номер табдицы лога|50: fn := toStringEvent(FileName); // имя текстфайла|34: if not FileExists(fn) then exit;|13: k:=0; i:=0;|20: AssignFile(F, fn);|11: Reset(F);|23: while not eof(F) do|11: begin|24: Readln(F, str_f);|43: replace(str_f, '"',chr(39),TestRep);|28: str:=copy(str_f,1,n);|56: if i=0 Then _hi_onEvent(onRead, 'BEGIN;'); |93: _hi_onEvent(onRead, 'INSERT INTO log'+Int2Str(tab)+' VALUES("'+str+'", "'+str_f+'";');|32: inc(k); inc(i); fl:=True;|22: if i=10000 then|23: begin|50: _hi_onEvent(onRead, 'COMMIT;');|29: fl:=False;|43: _hi_onEvent(onYes10000);|24: i:=0;|22: end;|10: end;|46: If fl then _hi_onEvent(onRead, 'COMMIT;');|15: CloseFile(F);|52: _hi_onEvent(onEnd, 'Loaded strings: '+Int2Str(k));|4:end;|0:|4:end.| link(onRead,4932360:doAdd,[]) link(FileName,10918588:Var,[]) link(nTab,6285917:Var1,[(167,131)]) link(EndCode,11007366:Var,[]) link(onYes10000,14134642:doExec,[(283,195)(283,251)]) link(onEnd,12486907:In,[]) AddHint(-4,42,110,39,@Hint) } Add(LineBreak,9847346,455,161) { Caption="+log" Color=65280 link(Out,14647768:doWork2,[]) Primary=[16331606,-343,77] } Add(GlobalVar,11007366,168,147) { @Hint=#93:количество символов в строке лога OllyDbg, занимаемых адресом машинных команд и именем потока| elink(4172861) AddHint(77,-21,199,39,@Hint) } Add(DoData,4363217,84,133) { Data=String(====== Analyze start! ======) link(onEventData,2043478:In,[]) AddHint(-9,-30,178,13,Data) } Add(HubEx,423252,504,140) { Angle=1 link(onEvent,14647768:doWork1,[]) } Add(LineBreak,10924094,455,140) { Caption="+log" Color=65280 link(Out,423252:doWork2,[]) Primary=[2043478,-329,-7] } Add(StrList,4932360,308,182) { } Add(HubEx,4925059,285,189) { link(onEvent,4932360:doClear,[]) } Add(LineBreak,13127540,455,203) { Caption="+Log" Color=65280 link(Out,12044509:doWork3,[(508,209)]) Primary=[12486907,-259,-7] } END_SDK
В этой строке можно изменить размер пачки. Думаю, что если поставить 500 или 1000, то будет работать быстрее.
|