Skip to content

Instantly share code, notes, and snippets.

@hector6872
Created September 11, 2018 15:51
Show Gist options
  • Save hector6872/13d7c3e851ead44cba264235077af56f to your computer and use it in GitHub Desktop.
Save hector6872/13d7c3e851ead44cba264235077af56f to your computer and use it in GitHub Desktop.
extract-strings-android script
#!/bin/bash
if [ -z "$1" ]
then
path="."
else
path=$1
fi
for filename in $path"/strings"*.xml; do
if [ -e "$filename" ]
then
echo "Extracting from... $filename"
sed '1,/<\/key>/! d; s/\(<[^<][^<]*>\)//g; /^$/d;' $filename > "$filename.text"
else
echo "No strings.xml files found in specified $path"
echo ""
echo "Use $0 [path]"
break
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment