Say we have a properties file at foo.properties
.
First, clean-up whitespace and empty lines, store in foo-1.properties
:
cat foo.properties | \
sed 's/[[:space:]]*=[[:space:]]*/=/' | \
sed 's/[[:space:]]*$//' | \
sed '/^$/d' > foo-1.properties