Results 1 to 2 of 2
Hi,
I have some text files I'm trying to sort. I want a utility that is able to insert a newline character after each specified character. (BASH Scripting)
So for ...
- 10-04-2011 #1Just Joined!
- Join Date
- Oct 2011
- Posts
- 1
Insert NewLine Character
Hi,
I have some text files I'm trying to sort. I want a utility that is able to insert a newline character after each specified character. (BASH Scripting)
So for instance:
Turns intoCode:The Quick: Brown Fox: Jumps Over: The Lazy Dog
Where the Colon ( : ) is the indicator of where to put the newline.Code:The Quick: Brown Fox: Jumps Over: The Lazy Dog
I don't know how to use sed, (I'd like to learn), so an explanation would be appreciated.
I've searched high and low looking for answers, and have come close, but not close enough.
Thanks for any answers,
Stefer
- 10-04-2011 #2Linux Guru
- Join Date
- May 2011
- Posts
- 1,843
Read the sed manpage:
Pay attention to the bit on:Code:man sed
Also, look at examples of sed in the scripts in /etc/init.d/ directory - there are plenty of sed examples there.Code:s/regexp/replacement/


Reply With Quote