Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi Friend,
In batch code, is it possible to read a particular line from the text file.
For eg.,
Text file "test1.txt" contains the following text....data1
data2
data3
data4
data5
I need to read the 3 line of the "test1.txt" file and print that line alone
(Ie.., It should echo the 3 line alone "data3")Is there any option to resolve this issue....
Thank in Advance.
Urs,
Vinoth

@echo off
for /f "skip=2 delims=" %%a in (file.txt) do (
echo Third line is "%%a"
goto :next
)
:next
echo Done.

![]() |
batch file string parsing
|
ping bat file
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |