Theory and Practice
About Archives Categories Tags Authors 中文 ไทย

[sed] Append Text at the Beginning of Each Line

March 15, 2016
Edit on Github

Append text at the beginning of each line via sed stream editor.

Append ``| `` to the beginning of each line.
sed 's/^/| /' tmp.txt > tmp2.txt

Tested on Ubuntu Linux 15.10, sed 4.2.2-6.1.


References:

[1]

sed append to end of line

sed - add text at the end of each line - Stack Overflow


Author: Siong-Ui Te
∈ Category: Bash
∑ Tags: Bash , Commandline , sed , String Manipulation , Regular Expression , reStructuredText
Powered by Github Pages, Pelican, pyScss.