Tag Archives: regex

Replace end of lines with commas in sed

Need to extract numbers and create a comma separated list: $ sed -e :label -e N -e ‘s/\n/, /’ -e ‘s/[ |]//g’ -e tlabel <<xxxx > |     919 | > |    1027 | > |    1593 … Continue reading

Posted in unix | Tagged , , , | Leave a comment