You are not logged in.
Pages: 1
Is it possible to set the input of a user as a text file here is a code I have
@echo off
Cls
Set /p fpath=" enter file path"
If %content of text file% == "lots of text" goto here
:here
Thanks
Last edited by Batcher (12 Dec 2015 01:45)
Offline
Your specification is a bit on the vague side.
Can you describe your goal?
How would you quantify "lots of text"? A particular number of lines? High byte count?
cmd | *sh | ruby | chef
Offline
You are setting a variable and not using it in the script.
Your aim is indeed unclear...
@echo off Cls Set /p fpath=" enter file path" If %content of text file% == "lots of text" goto here :here
Last edited by foxidrive (12 Dec 2015 12:13)
Offline
So let's say the text file contains the word false then the file will goto false
@echo off
Cls
Set /p fpath=" enter file path"
If %content of text file% == "lots of text" goto here
If %content of text file% ==false goto false
:here
Echo here
:false
Echo false
Last edited by Batcher (12 Dec 2015 13:19)
Offline
find /i "false" <"file.txt" >nul && goto false
Offline
This works for drive but "false"may not be the only input is there a way to use ?'s to represent more characters?
Offline
This works for drive but "false"may not be the only input is there a way to use ?'s to represent more characters?
My code answered your question.
If you hide the details of the task then you will not get the most appropriate code and answer.
Last edited by foxidrive (13 Dec 2015 13:22)
Offline
As foxidrive says, you're not providing enough information to elicit meaningful help.
Describe in words what it is you are try to achieve. Your pseudo code isn't really giving a great picture.
Provide real-world samples of input (anonymised if it contains anything sensitive) for the scenarios you want to cover and indicate what behaviours the different inputs should imply.
cmd | *sh | ruby | chef
Offline
.
Last edited by foxidrive (14 Dec 2015 16:30)
Offline
Pages: 1