3 ms·
The old line editor, ed, is good at this for files. I assume you could tinker a bit to get stdin support. echo -e "0r header.txt\nw" | ed spreadsheet.csv
by tyingq 6y ago
The old line editor, ed, is good at this for files. I assume you could tinker a bit to get stdin support.
echo -e "0r header.txt\nw" | ed spreadsheet.csv
- tyingq 6y agoReplying to my own post, looks like ex is more straightforward. ex -sc '0r header.txt' -c wq spreadsheet.csv And ugly, but works for stdin: echo "whee" | ex -sc '0r /dev/stdin' -c wq somefile