You can use the following sed command:
sed '{:q;N;s/\n//g;t q}' /path/to/data.txtYou can replace newline (\n) with * character or word 'FOO':
sed '{:q;N;s/\n/*/g;t q}' /path/to/data.txtOR
sed '{:q;N;s/\n/FOO/g;t q}' /path/to/data.txtOR replace it with tab (\t):
sed '{:q;N;s/\n/\t/g;t q}' /path/to/data.txtTo update file use -i option:
sed -i '{:q;N;s/\n/\t/g;t q}' /path/to/data.txt
No comments:
Post a Comment