Merging txt using DOS Batch

September 29, 2010 at 04:02:03
Specs: Windows XP
Hi there,

I have a small problem wherein I must be able to find out the text '<node>'[starting with <node> and ending with </node>] in the input.txt file and replace with all the text that has a pattern '<node-n'[starting with <node-n and ending with </node-n>] from merge.txt onto input.txt.

Similarly I must be able to find out the '<child>' in the input.txt and replace with all the text that has a pattern '<child-n' from merge.txt onto input.txt

:: Contents of input.txt before merging::

<some parent node>
<some node details>
...................
...................
<node>some node value</node>
<node>some node value</node>
<child>some child value</child>
<child>some child value</child>
...................
...................
<some node details>
<some child node>

:: Contents of merge.txt::

<node-n n=1>some node value</node-n>
<node-n n=2>some node value</node-n>
<node-n n=3>some node value</node-n>
<node-n n=4>some node value</node-n>

<child-c c=1>some child value</child>
<child-c c=2>some child value</child>
<child-c c=3>some child value</child>


:: Contents of input.txt after merging::
<some parent node>
<some node details>
...................
...................
<node-n n=1>some node value </node-n>
<node-n n=2>some node value </node-n>
<node-n n=3>some node value </node-n>
<node-n n=4>some node value </node-n>

<child-c c=1>some child value</child>
<child-c c=2>some child value</child>
<child-c c=3>some child value</child>
...................
...................
<some node details>
<some child node>


See More: Merging txt using DOS Batch

Report •


#1
September 29, 2010 at 04:49:50
I don't think this will get done in DOS.


=====================================
Helping others achieve escape felicity

M2


Report •
Related Solutions


Ask Question