Solved batch file to make new files, with lines ending with 00

Lenovo / Lenovo h420
April 18, 2012 at 06:21:42
Specs: Windows 7, 3.001 GHz / 8174 MB
Hi, can some one please help me with a batch file.
I get regularly text files which contains lines as below:
PINVABC;001361;000;0000182;12/2014;20.00;0100001245;882
PINVABC;001361;000;0000182;12/2014;20.00;0100001245;882
some other text
PINVABC;001361;000;0000182;12/2014;20.00;0100001245;550
PINVABC;001361;000;0000182;12/2014;20.00;0100001245;550
.....
(There are about 30 such types of lines)
What I would like to do the requested batch is:
to create a text file containing all lines ending with;882
to create a text file containing all lines ending with;550
and so on
For any help, I will be very thanks full

See More: batch file to make new files, with lines ending with 00

Report •


#1
April 18, 2012 at 09:24:05
✔ Best Answer
WARNING: Script not tested.

@echo off & setlocal EnableDelayedExpansion
for /F "delims=" %%i in ('type "file.txt"') do (
  for %%j in (%%i) do set tag=%%j
  echo.%%i>> "file!tag!.txt"
)


Report •

#2
April 18, 2012 at 10:25:01
Loved your work. Thanks very very much. Tom's Guide is the best

Report •

Related Solutions


Ask Question