Skip to content

Instantly share code, notes, and snippets.

@nicolascarrascob
Created October 1, 2020 04:46
Show Gist options
  • Save nicolascarrascob/3f1ac60189cd382dc60040e3464bcb9b to your computer and use it in GitHub Desktop.
Save nicolascarrascob/3f1ac60189cd382dc60040e3464bcb9b to your computer and use it in GitHub Desktop.
#!/bin/bash
FROM_ENCODING="value_here"
TO_ENCODING="UTF-8"
CONVERT=" iconv -f $FROM_ENCODING -t $TO_ENCODING"
for file in *.txt; do
$CONVERT "$file" -o "${file%.txt}.utf8.converted"
done
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment