unix - how to check for a pattern at the end of a line and delete new line -



unix - how to check for a pattern at the end of a line and delete new line -

i trying clean file looks like:

insert....; update.....; del ete.......; in sert........;

i remove new line characters lines don't end semicolon , after cleaning file should like:

insert.......; update.......; delete.......; insert........;

you mean this?

$ cat in insert....; update.....; del ete.......; in sert........; $ awk '{if ($0 ~ /;$/) {print} else {printf ("%s", $0)}}' in insert....; update.....; delete.......; insert........;

unix

Comments

Popular posts from this blog

javascript - THREE.js reposition vertices for RingGeometry -

javascript - I need to update the text of a paragraph by inline edit -

assembly - What is the addressing mode for ld, add, and rjmp instructions? -