Question

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,
Was it helpful?

Solution

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
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top