Get rid of junk character in a file

I have a file with one of the following lines, when opened with vi
33560010686GPT£120600GBPGBP10082007DS
In the above line, I want to get rid of the junk character before the � (pound sysmbol).
When I tried copying � from windows and copy in unix vi, it prints as £ and I tried pattern replace options in vi, but of no use

Thanks in advance

Assume you have a file named "file.txt", containing only one of your "dirty" line. First, you have to determine the octal code of the junk character, which is the 15th of the line:

od -b file.txt

0000000 063 063 065 066 060 060 061 060 066 070 066 107 120 124 302 243
0000020 061 062 060 066 060 060 107 102 120 107 102 120 061 060 060 070
0000040 062 060 060 067 104 123 012
0000047

Now that you have the octal representation of the character you want to remove, try:

cat file.txt | tr -d '\302'

Bye :slight_smile:

Thanks a lot robotronic.
That really works