1) I would like to use a string which exist at n th line number of data file(file containing lines of words) .
2)And to parse the exact data what i need for further operations( ":" symbol to separate left and right data to use
Example:
File data as below:
-----------------------------FILE DATA_START-----------------------------
aASA
ASAS
ASAS
Name: Wireless 1111 (VE-OD-APSH) Mobilephone Broadcast Card-Mini AEMN (COM23)
ASASAS
ASASSSA
ASASSA
-----------------------------FILE DATA_ENd-----------------------------
1>In the above I need fourth line data .. Let us say if u say line number 4, i need to get that data
2>In the current line I need to split the data by symbol ":" , Left side and right side, which i can use for further operations.
Echo specified Line number data based on inout line number
Moderator: DosItHelp
Re: Echo specified Line number data based on inout line numb
Try
or
Regards
aGerman
Code: Select all
@echo off &setlocal
for /f "usebackq skip=3 tokens=1* delims=:" %%a in ("text.txt") do (
set "left=%%a"
set "right=%%b"
goto :exitFor
)
:exitFor
echo %left%
echo %right%
pause
or
Code: Select all
@echo off &setlocal
for /f "tokens=1* delims=:" %%a in ('more +3 "text.txt"') do (
set "left=%%a"
set "right=%%b"
goto :exitFor
)
:exitFor
echo %left%
echo %right%
pause
Regards
aGerman