Re: [Trisquel-users] Remove BOM from UTF8 files

2020-07-02 Thread Ade Malsasa Akbar
Amazing. Glad to know that worked! Thanks to lcerf and enduzzer for explaining my command I learned new thing.

Re: [Trisquel-users] Remove BOM from UTF8 files

2020-07-01 Thread sabrinakitty
Thanks, everyone! This code did the job: #!/bin/bash for filename in $HOME/Documents/bom/*.log; do sed -i $'1s/^\uFEFF//' "$filename" done

Re: [Trisquel-users] Remove BOM from UTF8 files

2020-07-01 Thread enduzzer
No doubt a for loop would do the trick. https://en.wikipedia.org/wiki/For_loop

Re: [Trisquel-users] Remove BOM from UTF8 files

2020-07-01 Thread enduzzer
There's a utility 'bomstrip' (tool to strip Byte-Order Marks from UTF-8 text files). sudo apt install bomstrip https://www.ueber.net/who/mjl/projects/bomstrip/ http://muzso.hu/2011/11/08/using-awk-sed-to-detect-remove-the-byte-order-mark-bom

Re: [Trisquel-users] Remove BOM from UTF8 files

2020-07-01 Thread Ade Malsasa Akbar
Can't we just use looping for that? For example, I use this command to process multiple files. It removes lines with hashtag sign in every TXT file of all TXT files in current directory. What do you think? for filename in file*.txt; do sed -i '/#/d' $filename; done

Re: [Trisquel-users] Remove BOM from UTF8 files

2020-07-01 Thread enduzzer
That line seems to work as intended. Now, we need Magic Banana tell us how to process the remaining 699 log files automatically.

Re: [Trisquel-users] Remove BOM from UTF8 files

2020-07-01 Thread enduzzer
https://stackoverflow.com/questions/45240387/how-can-i-remove-the-bom-from-a-utf-8-file sed -i $'1s/^\uFEFF//' file.txt

[Trisquel-users] Remove BOM from UTF8 files

2020-06-30 Thread sabrinakitty
Hello BOM: Byte order mark Wikipedia article: https://en.wikipedia.org/wiki/Byte_order_mark The UTF-8 representation of the BOM is the (hexadecimal) byte sequence 0xEF,0xBB,0xBF. The Unicode Standard permits the BOM in UTF-8, but does not require or recommend its use. I have 700 log files