motorcross
Goto Top

Per Batch ein bestimmtes Word aus einer txt.Datei als Variabele setzten

Hallo Administratoren,

ich möchte per Batch Datei ein Wort aus einer .txt Datei als Variabele setzten.
Das wort befindet sich in der ersten Reihe und ist das 6 Wort.
Dieses Wort ist eine Zahl.
Gruß Motorcross

Content-Key: 116523

Url: https://administrator.de/contentid/116523

Printed on: April 20, 2024 at 03:04 o'clock

Member: bastla
bastla May 21, 2009 at 09:03:16 (UTC)
Goto Top
Hallo Motorcross!

Etwa so:
@echo off & setlocal
set /p Zeile=<"D:\Die Datei.txt"  
for /f "tokens=6" %%i in ("%Zeile%") do set "Zahl=%%i"  
echo %Zahl%
Grüße
bastla

[Edit] @77559:
heh bastla heute bin ich wohl der Haase face-sad
Aber nur ganz ausnahmsweise ... face-wink
[/Edit]
Mitglied: 77559
77559 May 21, 2009 at 09:07:02 (UTC)
Goto Top
Sag mal Motorcross,

du hast doch jetzt schon so viele Hinweise bekommen.
Wird es nicht langsam Zeit, das du dich selber mal kreativ mit den einzelnen Befehlen auseinandersetzt?

@echo off
set /P Zeile=<Datei.txt
for /f "tokens=6" %%A in ("%Zeile%") do set Wort=%%A  

Gruß
LotPings

Edit Fehler entfernt, heh bastla heute bin ich wohl der Haase face-sad