0

Input

aaaa bbbb cccc 

Output

aaaa < _jupijuice_ > bbbb < _jupijuice_ > cccc < _jupijuice_ > 

In simple words, replace \n with \n< jupijuice >\n

4 Answers 4

5
awk '{print; print "< _jupijuice_ >"}' input.txt 

Output:

aaaa < _jupijuice_ > bbbb < _jupijuice_ > cccc < _jupijuice_ > 
Sign up to request clarification or add additional context in comments.

Comments

4

In regular expressions you can use $ to match end of line:

sed 's/$/\n< _jupijuice_ >/' input.txt 

1 Comment

no need of the cat, just give the file name to sed directly ;-). \n in other sed than GNU will failed if in replacment pattern, you need a real new line in this case.
3
sed 'a\ < _jupijuice_ >' YourFile 

append a line <...> after each line

2 Comments

what is best is best → sourceforge.net/projects/anytextfile this is my program, needed this small sed command for dividing blocks, for books reading, tweets reading like from github.com/sferik/t etc.
sorry, don't have access to your project code. Using a sed into another package is maybe not the best. I don't know lazarus code but ther is no code allowing text modfication as internal code ? Any instruction using regex manipulation will certainly suite your need
2

This should do:

awk '$0=$0"\n< _jupijuice_ >"' 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.