Jump to content

tkocsir

Active Members
  • Posts

    33
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

tkocsir's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Can somebody post a working hash39.dll? It still does not work on Windows 7. The problem is written in the sixth comment.
  2. Thanks UEZ (and Melba23), now it works great!
  3. The method is clear, but I don't understand why it doesn't want to do what it have to do... When I add this code to my script, then the final result of list is sorted by alphabetical order and not by the numbers... Your example works, but with the file lines it doesn't. I tried to figure out the problem but couldn't. (All I modify your code is to comment out the _arraydisplay lines and renaming $aArray to $array to match my code)
  4. Dear Melba23, Could please help me a little more? I tried to sort the result in alphabetical order by using _ArraySort($array, 0, 0, 0, 2), but it doesn't work. Or it works, but only "half"... If I sort the elements with this syntax, they will be sorted in alphabetical order, but in "groups". So the names come in order from a to z, and then it starts again and again. I don't know why. My goal is to make the script a list, where the elements are sorted by the number of their presence (this is what the script does right now - thanks! ), but the elements, which can be found the same time as other elements, would be listed in alphabetical order. For example: Now: orange 49 lime 34 zebra 34 apple 34 fruit 28 My goal: orange 49 apple 34 lime 34 zebra 34 fruit 28
  5. It works! Thank you very much for your help, you are great!
  6. Sorry, this is the right file. test.zip
  7. I attached 4 real files. They are in hungarian, but I renamed the hungarian line to "[Program Groups]".test.zip
  8. Thank you for your fast and professional reply Melba23! Maybe my english is not perfect, but I understand every comments of you. The script works great with a test.txt example files, but if I test it on the "real" ones, then the arraydisplay show the files not exactly in decreasing order. I mean, maybe there are more files at the top of the window with more "hits", but the order is not good. For example: exampleline 3 something 3 justaline 2 helloworld 2 lineline 3 someline 2 itsaline 2 lineee 1 lliinnee 2 weirdline 1 I haven't had time to search the problem yet, but if yo have idea just let me know. And thanks again!
  9. Hi! I have to read in some files, in every file search for the same specific line, then read in the nexxt lines until a blank line, while adding the lines to an array. This is a two dimensional array. If a line already appeared earlier (in an other file for example), then is mustn't add to the array, but must add +1 to the second dimension to demonstrate how many times the line was found. The script works almost perfect, except that it doesn't... I show you the script and then tell what is not working fine. #include <File.au3> #include <Array.au3> Global $files Global $array[1][2] Global $i = 0 $array[0][1] = 1 _dir(@ScriptDir) main() ;ConsoleWrite($i & @TAB & $array[$i - 1][1] & @CRLF) _ArraySort($array, 0, 0, 0, 2) For $k = 0 To $i - 1 ConsoleWrite($array[$k][0] & @TAB & $array[$k][1] & @CRLF) Next Func _dir($dir) Local $arritem, $item $arritem = _FileListToArray($dir, '*') If IsArray($arritem) Then For $n = 1 To $arritem[0] $item = $dir & '\' & $arritem[$n] If StringInStr(FileGetAttrib($item), 'D') Then ;This is a folder _dir($item) ;Call recursively Else ;This is a file $files &= $item & '|' EndIf Next EndIf EndFunc Func main() $files = StringSplit($files, '|') For $z = 0 To $files[0] $item = $files[$z] $fOpen = FileOpen($item) If StringRight($item, 4) = '.au3' Then ContinueLoop While 1 $line = FileReadLine($fOpen) If @error Then ExitLoop If StringInStr($line, '[Program Groups]') = 1 Then FileReadLine($fOpen) FileReadLine($fOpen) ; skipping two unnecessary lines While 2 $line2 = FileReadLine($fOpen) If @error Or $line2 = '' Then ExitLoop $add = False For $j = 0 To $i If $line2 = $array[$j][0] Then $array[$j][1] += 1 Else ReDim $array[$i + 1][2] $array[$i][0] = $line2 $add = True ;$i += 1 EndIf Next If $add = True Then $i += 1 ; but this will be True always, because one line is enough to set it True WEnd EndIf WEnd Next EndFunc I am testing this on 3 files, which are the duplicates of each other. Each contains the same 56 lines after the "[Program Groups]" line. The problem is that the $add boolean will be always True after the inner loop exists because of the same lines. So $i will be always added 1. After the Main function ends, $i will have the value of 168 instead of 56. (3×56) You can check this be removing the comment character from the consolewrite after main(). The loop after this shows the lines and the number, how many times they appeared (after sorted in decreased order). The output now is something like this: oneline 3 anotherline 3 someline 3 oneline 2 anotherline 2 someline 2 oneline 1 anotherline 1 someline 1 But I need a result like this: oneline 3 anotherline 3 someline 3 What is wrong? I know I should change something maybe with the $i += 1 thing, but I don't know... Please help, the script is almost done. Thanks!
  10. Jaca applications are not really supported by AutoIT...
  11. I don't know if you are using this command inside a loop, but if yes, then you should know that "net" command pauses the execution until it is finished but "sc" doesn't wait. So the RunWait, _RunDOS functions doesn't make it wait until finish.
  12. Any news? Anybody...?
  13. I need an AutoIT tool like Sigcheck.exe: http://technet.microsoft.com/en-us/sysinternals/bb897441 But for me it would be enough if the script could tell me if a Microsoft signed file is valid or not. I know it is free, but due to license limitations I am not allowed to use sigcheck.exe the way I want to. Using any of the codes above I never could get a result that says that "this MS file is signed and verified". (I ran the scripts on file like shell32.dll, explorer.exe, wintrust.dll,...)
  14. I'm thinking on a function that returns only if the specified file is signed or not by Microsoft. And the function must contain the public key for verifying MS signed files.
  15. @KaFu: I don't know if it helps you, but maybe: Start > Run > mmc > File > Add/remove snap-in > Certificate > OK > open a "folder", then double click on an owner > Details tab. @willichan: Thank you for your information and help, I save these scripts for later use.
×
×
  • Create New...