sed problem

Hi I am trying to use sed command as part of my script but it is not doing what I wanted it to do.....I have an xml file where there are instances I get "Holding1" and I want them to be changed to "Holding"...in my script I used it this way....

#! /usr/bin/sh
set -x
if [ -f old.xml ]
then
CNT_HLDING=`grep -c "Holding1" $HOME/old.xml`
if [ $CNT_HLDING -eq 1 ]
then
sed 's/Holding1/Holding/g' $HOME/old.xml > new.xml
chmod 770 new.xml
# mv new.xml old.xml
echo " Holding1 is now Holding...."
fi
else
echo " There are no Holding1 records..."
fi
--------
but it does not do that... when i tried the sed command on my terminal it did not work either....surprise is that it works when i take only part of the file and use the sed command on it.....I do not know whats wrong in this.....does sed have any limitation on xml files or length......
I dont understand why it is not doing it....any help is appreciated...

Thanks.

try this:

sed 's#Holding1#Holding#g' $HOME/old.xml

Thanks for the reply but it did not work....
here is what I noticed.....
when I copy the entire contents to a different file and do sed on that file it works...but it does not work on original file....what could be the reason..? I want is to work on original file as it will be generated by another system and everyhting will be automated.....do you know the reason why it works if I copy it to another file and does not work with original...I checked all permissions and alll....need some more clues..please.

do you have '^M' or any other control characters in the 'original' file?
you can see the control chars when going into 'vi' and setting ':set list'.

Hmmmm....Here is what it is...I am not able to see anything if i vi the file it is blank.....I checked it three times to be sure....BUT there is a message saying that "A line cannot be longer than 2048 characters" that means the xml has it in one single line....am I correct....

that's correct.
if that's the case 'sed' has a limitation as far as the leghth of a single line goes.

Is it your intent to have ONE single line or is there something 'screwed up'?

You can also display the control characters with:
cat -vet fileName

Thanks a lot....for the inputs...It was the xml in just one single line that was problem....it is resolved now.....thanks once again....

This forum proved to be very useful once again.....