String Manipulation with Output of FINDSTR
Posted: 16 Sep 2009 22:02
Hi,
I'm parsing this kind of file
Wings\IDSS_SAR_Wings_rev2.bdf:CBEAM 10063579120000601003334410047685 0. -1. 0.
Wings\Rigids_SAR_ATD_Snubbers_V2.bdf:RBE2 1010000010053768 123456 202383 202427 202429 202470 202478+
Wings\Rigids_SAR_ATD_Snubbers_V2.bdf:CBUSH,10100111,10100100,11000011,10033349,,,,0
Beams\ATDs_rev3.bdf:RBE2 1010000411000009 123456 116283 116284 117263 117264 117265+
with this commandline FOR /F " tokens=1,2,3* delims=,: " %i IN ('type C:\_Consulting\RCM\PhaseB\Models\Master_Model\TempElms.txt') DO echo.%i %k:~0,8%
The issue I have is that %k is always the same. It takes the last line value and echos it for each line. I have no clue what to change.
OUTPUT
Wings\IDSS_SAR_Wings_rev2.bdf 10100015
Wings\Rigids_SAR_ATD_Snubbers_V2.bdf 10100015
Wings\Rigids_SAR_ATD_Snubbers_V2.bdf 10100015
Beams\ATDs_rev3.bdf 10100015
Any help would be appreciated,
Thanks,
I'm parsing this kind of file
Wings\IDSS_SAR_Wings_rev2.bdf:CBEAM 10063579120000601003334410047685 0. -1. 0.
Wings\Rigids_SAR_ATD_Snubbers_V2.bdf:RBE2 1010000010053768 123456 202383 202427 202429 202470 202478+
Wings\Rigids_SAR_ATD_Snubbers_V2.bdf:CBUSH,10100111,10100100,11000011,10033349,,,,0
Beams\ATDs_rev3.bdf:RBE2 1010000411000009 123456 116283 116284 117263 117264 117265+
with this commandline FOR /F " tokens=1,2,3* delims=,: " %i IN ('type C:\_Consulting\RCM\PhaseB\Models\Master_Model\TempElms.txt') DO echo.%i %k:~0,8%
The issue I have is that %k is always the same. It takes the last line value and echos it for each line. I have no clue what to change.
OUTPUT
Wings\IDSS_SAR_Wings_rev2.bdf 10100015
Wings\Rigids_SAR_ATD_Snubbers_V2.bdf 10100015
Wings\Rigids_SAR_ATD_Snubbers_V2.bdf 10100015
Beams\ATDs_rev3.bdf 10100015
Any help would be appreciated,
Thanks,