Page 1 of 1

Checking if a line in a fIle contains an environmental variable

Posted: 25 Mar 2016 17:21
by batchcc
I have one.bat two.bat three.bat and four.bat in wichone.bat calls one of the other 3 file based on the letter the user input starts with. Then the called file let's say two.bat checks the user input in this form

Code: Select all

If %word% == sleep echo dormir ----- %oue%
Rem there are more lines in this exact format

How can I can I check if the line contains the variable %oue% and if it does do something like echo contains variable.

Re: Checking if a line in a fIle contains an environmental variable

Posted: 25 Mar 2016 17:28
by foxidrive
Purely as a point of discussion, your question confuses me and I can't see how this situation could arise.

Re: Checking if a line in a fIle contains an environmental variable

Posted: 25 Mar 2016 17:40
by batchcc
I need to conjugate the verb dormir with would be duermo duermes duerme ... by checking the variable oue so the o changes to ue and using the code here viewtopic.php?f=3&t=6961#p45287 with I originally used in a file to calculate a squared number I can search for the letter o.

Re: Checking if a line in a fIle contains an environmental variable

Posted: 25 Mar 2016 17:49
by foxidrive
Many people ask questions in a way that the task bears no resemblance to what is being done - it ends up wasting the volunteers times, because batch files are so specific to the task that what is given as an answer doesn't work.

I am also a little bit annoyed that you didn't reply to Squashman at that thread, after he gave you a solution.

Re: Checking if a line in a fIle contains an environmental variable

Posted: 25 Mar 2016 17:55
by batchcc
Sorry.