Computing.Net > Forums > Programming > Delete text range using batch 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.

Delete text range using batch file

Reply to Message Icon

Name: AstiPup
Date: February 9, 2009 at 15:49:31 Pacific
OS: Windows XP
CPU/Ram: Dual Core
Product: Hewlett-packard / Nw8440
Subcategory: Batch
Comment:

Hi all,

In short, I have an XML file that needs to have some information deleted from it when a batch file runs. The file's data changes constently, so I cannot select only certain line #s to delete or only lines containing a predefined text string.

Is there a way to delete all text from "x" to "y" in a text file using a batch file?

A sample of the XML is listed below. In this sample I'd like to find the text starting with <connections> and ending with </connections> and then delete it:

</POLICE-REPORTS>
<QUEUE-MANAGER>
<CONNECTIONS>
<MASI_QMAFR_REPORTS>B360DEC2129B
<AMS_QMDATA>449A10725EDB51F53
<AMS_DEFAULT>449A1
</CONNECTIONS>
<DATAOBJECTS>
<MAXLOGSIZE>D98E38

I'm very new to this, and could only find posts with examples to delete specific lines or matched text, not a range. Any help is greatly appreciated.

THANKS!




Sponsored Link
Ads by Google
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: Delete text range using batch file

Piping text within a batch file www.computing.net/answers/programming/piping-text-within-a-batch-file/11068.html

Delete blank lines with batch file? www.computing.net/answers/programming/delete-blank-lines-with-batch-file/13018.html

Merging text files using batch file www.computing.net/answers/programming/merging-text-files-using-batch-file/19906.html