Checking if a line in a fIle contains an environmental variable

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
batchcc
Posts: 139
Joined: 17 Aug 2015 06:05
Contact:

Checking if a line in a fIle contains an environmental variable

#1 Post by batchcc » 25 Mar 2016 17:21

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.

foxidrive
Expert
Posts: 6033
Joined: 10 Feb 2012 02:20

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

#2 Post by foxidrive » 25 Mar 2016 17:28

Purely as a point of discussion, your question confuses me and I can't see how this situation could arise.

batchcc
Posts: 139
Joined: 17 Aug 2015 06:05
Contact:

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

#3 Post by batchcc » 25 Mar 2016 17:40

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.

foxidrive
Expert
Posts: 6033
Joined: 10 Feb 2012 02:20

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

#4 Post by foxidrive » 25 Mar 2016 17:49

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.


Post Reply