|
|
|||||||
Hi, I'm new with Kix, this is my question: I'need found a string in a specific file, i don't find any command. Please Help me. Thank You |
||||||||
|
|
|||||||
be more specific. do you need to replace a string? do you need only to find if it is present? do you need to return the string? |
||||||||
|
|
|||||||
Sorry, I need find If the string is present in a file |
||||||||
|
|
|||||||
see this link http://www.kixtart.org/board/ultimatebb.php?ubb=get_topic;f=1;t=007764 |
||||||||
|
|
|||||||
Hi Radimus, I don't understand the URL what it's the command to find string in a file?. |
||||||||
|
|
|||||||
you can't find it in a file, you have to read the file and then do an instr() on each line |
||||||||
|
|
|||||||
Alternatively, if you just want to check if the string is in the file, used the DOS "FIND" command. For example: code:Will search myfile.txt for "string".FIND /I "string" myfile.txt The exit code will be "0" if the string is present, and "1" if it is not. In KiXtart you can "Shell" the command and check @ERROR or %ERRORLEVEL% |
||||||||
|
|
|||||||
See also the following UDF: IsStringInFile() - Checks whether a string is present in a file |