.bat to seperate records from flat file

Ms / Windows 2003
May 1, 2009 at 09:45:59
Specs: Windows 2003
Hi All,

Basically we have flat file records as follows,

01#77735601#gggg#XXXXXTTTTT
03#74335941#ttgg#XXXXXJJTTT
01#77665601#ggll#XXXXXTTUUT

Based on the first 2 characters, we need to seperate the records.

For example, records beginning with 01# should be written in a seperate file and for 02#, 03#....06# like wise.

Is it possible in .bat script? we tried with FINDSTR command but it seperates records in all the occurances.

Plz advice.


See More: .bat to seperate records from flat file

Report •


#1
May 1, 2009 at 12:43:44
@echo off
for /F "tokens=1* delims=#" %%j in (File_To_Split) do echo.%%j#%%k>> File_%%j.txt


Report •
Related Solutions


Ask Question