perl -e"BEGIN{$/=''}" -ple"tr[\n][]d" input.file > output.file