add script to remove binary characters and add BOM

This commit is contained in:
Gunther Schulz
2020-02-16 11:51:25 +01:00
parent 036c2d4cfd
commit 34af70c043
Executable
+12
View File
@@ -0,0 +1,12 @@
#!/bin/sh
# https://www.commandlinefu.com/commands/view/11560/delete-all-non-printing-characters-from-a-file
# http://www.skybert.net/bash/adding-utf-8-bom-from-the-command-line/
# Remove non-printable ASCII characters
tr -cd '[:print:]\n\r' < ./Experts/JsonAPI.mq5 > ./Experts/JsonAPI.clean.mq5
# Add UTF-8 BOM
sed -i '1s/^/\xef\xbb\xbf/' ./Experts/JsonAPI.clean.mq5
mv ./Experts/JsonAPI.clean.mq5 ./Experts/JsonAPI.mq5