Both sides previous revisionPrevious revisionNext revision | Previous revision |
pub:tech:sed [2023/03/04 15:46] – cat | pub:tech:sed [2024/02/10 14:32] (current) – cat |
---|
====== SED ====== | ====== Sed ====== |
{{htmlmetatags>metatag-robots=(follow, index) | {{htmlmetatags>metatag-robots=(follow, index) |
metatag-keywords=(bsd,editor,editors,gnu,linux,regex,regexp,regular expression,sed,unix) | metatag-keywords=(bsd,editor,editors,gnu,linux,regex,regexp,regular expression,sed,unix) |
metatag-description=(Text editing tools, real life examples, *BSD, GNU/linux, linux) | metatag-description=(Text editing tools, real life examples, *BSD, GNU/linux, linux) |
}} | }} |
{{tag>[editing editor regex text]}} | |
| {{tag>editing editor regex text}} |
| |
[[.:|{{mdi>arrow-left-circle}}]] | [[.:|{{mdi>arrow-left-circle}}]] |
| |
- '':a'' puts a label. | - '':a'' puts a label. |
- ''N'' append the next line into pattern space (which contains the current line) | - ''N'' appends the next line into pattern space (which contains the current line) |
- ''s/\n/ /'' substitues the newline character with a space character | - ''s/\n/ /'' substitues the newline character with a space character |
- ''ta'' jumps to label ''a'' if it's previous command ends successfully | - ''ta'' jumps to label ''a'' if it's previous command ends successfully |
| |
https://askubuntu.com/questions/164056/how-do-i-combine-all-lines-in-a-text-file-into-a-single-line/996766#996766 | https://askubuntu.com/questions/164056/how-do-i-combine-all-lines-in-a-text-file-into-a-single-line/996766#996766 |