Changing Special Characters Using Sed

Hi. Does anyone know how to use the sed command to change the special border characters on this .per file. I have to edit about 80 .per files. I need a sed script to change the below 3 and A characters.

�����������������������������������������������������������������������������Ŀ
� Test Islands, Office of Public Health -- WIC Computer Support System 1.0 �
�����������������������������������������������������������������������������Ĵ
� �
� C L I N I C M A I N M E N U �
� �
� 1 - Create/Update Patient 10 - Voucher Maintenance �
� 2 - WIC Case Maintenance 11 - Display Patient Events �
� 3 - WIC Case Data Sheet 12 - View Patient Medical Records �
� 4 - 13 - Written Manual Voucher Entry �
� 5 - Edit Patient Food Package 14 - WIC Case Inquiry �
� 6 - Record Patient Event/Sched 15 - Record Group Education Events �
� 7 - 16 - �
� 8 - Register Nutritional Ed 17 - Schedule Patients �
� 9 - Discharge Clients 18 - Show Family Relationships �
� �
� Q - Quit From System �
� �
� Enter Number of Selection: [a1] �
�������������������������������������������������������������������������������

You have more funky characters in that file than the two that you mentioned. You may want to change them as well.

I will show you how I would approach something like this. I am using ksh as my interactive shell. That is important because my solution depends on the echo statement.

Let's say that I want to change all of my � characters to be a hyphen character. It is possible that a simple "sed s/�/-/g" would work, But I don't like to use non-ascii characters.

First I need to know the octal value for � and I will use od -c for that.
od -c < funky.txt
OK, it is 304.

Now I need an echo statement to create a single instance of that character. I will test the echo statement to be sure it's working:
echo \\0304\\c ; sleep 5
The sleep 5 gives me some time to view the character before my prompt overwrites it.

Now I can construct the sed statement:
sed "s/$(echo \\0304\\c)/-/g" < funky.txt

Perderado,

Can I use the same procedure for the Bash shell?

It looks like
echo -e \\304\\c
will work in bash.

Perderabo,

Thanks. The echo command returned the character.