Hello!
Thanks in advance for any help you can provide, I have what I think should be a simple issue but I cannot seem to find the solution. I have a very small batch file that i use to select two random words from a text file of thousands of words. Currently, it returns results in two separate rows, such as:
RandomWordOne
RandomWordTwo
I would instead like it to return these on one line with a space in between, like this:
RandomWordOne RandomWordTwo
Below is the simple code I am using, I have connected the commands on one row with & but cannot get the output on one line:
@echo off
set /a rnd=%random%%%370103
set /a rnd2=%random%%%370103
for /f "tokens=1,2" %%a in (list.txt) do if %rnd%==%%a echo %%b & for /f "tokens=1,2" %%a in (list.txt) do if %rnd2%==%%a echo %%b
pause