echo -e "0r header.txt\nw" | ed spreadsheet.csv
ex -sc '0r header.txt' -c wq spreadsheet.csv
echo "whee" | ex -sc '0r /dev/stdin' -c wq somefile