#!/bin/sh -f

for f in $* ; do
  echo "Convert $f" 1>&2
  cat $f | \
    sed -e 's#[ ]$#'__$$$$__'#' | \
    tr '\r' ' ' | \
    sed -e 's#[ ]$##' -e 's#'__$$$$__'$# #' >t$$; mv t$$ $f
done

