|"Please, don't take account that the text occurs more than once in file."|
Er, I guess you mean just get the first instance of the string (in the case where there is more than one)?
And, do you want case-sensitive or ignore-case?
But I think M2's approach is probably the most efficient: just use "find" or "findstr" (either one will do, and either one can ignore case if politely asked to do so.)