The file which I am processing (param.txt) is tab delimited and the contents of the first column are _ delimited.
param.txt
ONE_one two three
FOUR_four five six
SEVEN_seven eight nine
I've created below script to process this file:
@echo off & setlocal enableextensions enabledelayedexpansion
for /f "tokens=1,2,3 delims= " %%G in ('type param.txt') do (
for /f "tokens=1 delims=_" %%a in ('echo %%G') do (
echo %%a -- %%b -- %%H -- %%I
)
)
endlocal & goto :EOF
This produces the below output:
ONE -- %b -- two -- three
FOUR -- %b -- five -- six
SEVEN -- %b -- eight -- nine
What needs to be rectified in the script to get it to print the "value" instead of %b?