I'm trying to make a find command find the line that says "1-Male;" in a file called "gender.txt" in the same directory. The problem is that the find command also echos a blank line and the directory of said gender.txt, and I want to know how do I get the find command to, you know, not say those two lines?
@echo off
color 0a
title Test #1
echo What gender do you want to be?
echo[
echo 1. Male
echo 2. Female
echo 3. Robot
echo[
choice /c 123 /n /m ">"
set index=%errorlevel%
find "%index%" "%cd%\gender.txt"
pause & exit /b
I should also probably say what's the contents in "gender.txt".
1-Male
2-Female
3-Robot
findstr
instead offind
%cd%
does not contain 1,2 or 3:find "%index%" "%cd%\gender.txt"|find "%index%"
or another approachtype "%cd%\gender.txt"|find "%index%"
.