<FONT face="Default Sans Serif,Verdana,Arial,Helvetica,sans-serif" size=2><div><font color="#990099">-----kwlug-disc-bounces@kwlug.org wrote: -----<br></font>>On Fri, 2009-04-03 at 15:41 -0400, Robert P. J. Day wrote:<br>>individual lines, when --pretty is used to create the files,<br>>otherwise<br>>very long lines with multiple tags.<br><br>I would use 'ed' and pipe in the commands from a script.<br><br>e.q.:<br><br>#!/bin/bash<br>#<br># This file has not been run, there may be errors.<br><br>FILE="myfile.xml"<br>START=1<br><br>count=`grep '<mytag>' myfile.xml | wc -l`<br><br>( # subshell<br> x=0<br> while [ $x -lt $count ]; do<br> value=(($x + $START))<br> echo "/<mytag>"<br> echo "s:<mytag>.*</mytag>:<mytag>$value</mytag>:"<br> done<br> echo "w"<br> echo "q"<br>) | ed myfile.xml<br></div></FONT>