cat data.txt | perl -00pe 's/\\n/,/g' #### cat data.txt | perl -l -00pe 's/\n/,/g'