Computing.Net > Forums > Unix > replace - with new line(\n)

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

replace - with new line(\n)

Reply to Message Icon

Name: Venkat
Date: September 25, 2002 at 00:56:38 Pacific
OS: UNIX
CPU/Ram: 256
Comment:

need one seed command it should replace one
characater(-) with new line in file " mfile".
i tryed with this , but is not working.

sed 's/^-/\n/g' mfile >>tt



Sponsored Link
Ads by Google

Response Number 1
Name: David Perry
Date: September 25, 2002 at 04:09:54 Pacific
Reply:

try tr


0

Response Number 2
Name: LANkrypt0
Date: September 25, 2002 at 05:03:22 Pacific
Reply:

tr is correct, syntax would be
tr "[x]" "[\n]"

Where x is the character you need replaced.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


Berkeley source code for ... Help in writing script



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: replace - with new line(\n)

replace pattern with new line www.computing.net/answers/unix/replace-pattern-with-new-line/7944.html

replace a string to new Line www.computing.net/answers/unix/replace-a-string-to-new-line/6822.html

Unix Sed - inserting new lines www.computing.net/answers/unix/unix-sed-inserting-new-lines/6487.html