Archive: Search Str in a txt file


Search Str in a txt file
how can i let the installer look for a word randomly disposed in a text file?

tnx


Use FileOpen, FileRead, FileClose and StrCmp to find the string. There are lots of examples in the Archive and maybe some function that even do exactly this.

The Archive can be found at:
http://nsis.sourceforge.net/archive/nsisweb.php

You'd probably want to start with this category:
http://nsis.sourceforge.net/archive/...instances=0,11


The specific one you want is here:
http://nsis.sourceforge.net/archive/...ances=0,11,311

-Stu


i use this, but don't work... search a str only in fist line :/

help me pls

[edited by kichik]attached below :down:[/edit]


I think you can correct your FileSearch function by adding one line to it. Change

   StrCpy $9 0
filter_top:
IntOp $5 $5 - 1
to
   StrCpy $9 0
StrCpy $5 0 ; this line has been added
filter_top:
IntOp $5 $5 - 1

Attach large scripts next time.