BOM characters in vi and more commands

2.5k views Asked by At

I wanted to remove BOM from a file but if use more there are visible but if i use vi to edit they are not visible.Please help to find the way.

0000199494 : more

0000199494 : vi

[root@axydevt1 axwdev]# more /home/axwdev/PO20131203141833_2.txt
0000199494      S         201312022013120220131203        PO-1312-00187       YES       SAM0196   èå·æ浩çµå­æéå
¬å¸(RMB)          0512-66395196, 0512-6639
7152       SM7            RMB8300                    


[root@axydevt1 axwdev]# vi /home/axwdev/PO20131203141833_2.txt
0000199494      S         201312022013120220131203        PO-1312-00187       YES       SAM0196   èå·æ浩çµå­æéå
7152RMB)   SM7    0512-663RMB83000512-66399                         Costs, insurance & freight         0.170   17% input tax,
1

There are 1 answers

2
Ry- On BEST ANSWER

With Vim, you should be able to just open the file, :set nobomb, and write it out again. Alternatively, using sed:

sed -i 's/\xef\xbb\xbf//' PO20131203141833_2.txt