batch read text

Microsoft Windows vista home basic - 32-...
August 2, 2010 at 15:06:46
Specs: Windows Vista, 3.4 GHz / 2045 MB
Hello
I need cmd to read a text file and copy the first line and paste it like this
goto %the text from the text file here%
Like a video game with saved game

See More: batch read text

Report •


#1
August 2, 2010 at 15:40:42
SET /p LabelName= <FileName.txt
GOTO %LabelName%

Change "LabelName" and "FileName" to whatever applies to you.


Report •

#2
August 2, 2010 at 16:44:06
THX
ALOT
:D :D :D

Report •

#3
August 2, 2010 at 18:19:01
It doesn't need to be from the first line however.

Using this code, you will be able to have multiple load points within one file.

@ECHO OFF
SETLOCAL EnableDelayedExpansion

FOR /f "tokens=*" %%a IN ('FINDSTR LabelName "P:\a\t\h\FileName.txt"') DO  (
	SET Variable=%%a
)
GOTO %Variable%

Both will work, but this one will allow to have just one file.


Report •

Related Solutions

#4
August 3, 2010 at 09:43:10
Nevermind, that code won't work. It require you to know the load point, before it loads. IE it doesn't do what you want it to.

I couldn't edit as I'm on my iPhone, and it won't let me hehe.


Report •

#5
August 6, 2010 at 10:23:12
IPHONE ?!?!? So you mean that every thing you have typed to me has been on the iphone . lol .

Report •

#6
August 6, 2010 at 11:23:33
No, I was at work when I said that. Everything else was on my laptop.

Report •


Ask Question