batch script for parsing text file

April 23, 2009 at 12:23:41
Specs: Windows XP
I have this text file that is one long string with
no carriage return. What I want to do is a line
break or carriage return whenever it finds the
text string "~NM1" Here is what I have so far.

> newfile
For /f "tokens=1,* delims=~NM1" %%a in (%*)
Do (
Echo.%%a
If not "%%b"=="" Call :SPLIT %%b)
GoTo :EOF
:SPLIT
For /f "tokens=1,* delims=~NM1" %%a in ("
%*") Do (
Echo.%%a
If not "%%b"=="" Call :SPLIT %%b)
GoTo :EOF

I run it and get no errors but it does not do anything. I got some of this code from previous post on this site. Thanks to anyone who can point out what I am doing wrong or missing.


See More: batch script for parsing text file

Report •


#1
April 23, 2009 at 17:55:00
from where did you get that string? from a file? from user input?

Unix Win32 tools | Gawk for Windows


Report •
Related Solutions


Ask Question