Computing.Net > Forums > Programming > batch script for parsing text file

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

batch script for parsing text file

Reply to Message Icon

Name: alphatech
Date: April 23, 2009 at 12:23:41 Pacific
OS: Windows XP
Subcategory: Batch
Comment:

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.



Sponsored Link
Ads by Google

Response Number 1
Name: ghostdog
Date: April 23, 2009 at 17:55:00 Pacific
Reply:

from where did you get that string? from a file? from user input?

Unix Win32 tools | Gawk for Windows


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: batch script for parsing text file

batch script to parse text file www.computing.net/answers/programming/batch-script-to-parse-text-file/16793.html

Batch Script for Reading/Parsing www.computing.net/answers/programming/batch-script-for-readingparsing-/16003.html

batch file to parse text file www.computing.net/answers/programming/batch-file-to-parse-text-file/18030.html