LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-05-2009, 12:53 AM   #1
magicstyle
LQ Newbie
 
Registered: Oct 2009
Posts: 3

Rep: Reputation: 0
Angry how do I replace.... text quesiton


how do I replace all occurences of

><

with

>
<

?


thank you
 
Old 10-05-2009, 01:11 AM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
This looks like it might be homework---please tell us a bit more about the context.

Have you looked at SED? Here's the most often recommended tutorial:
http://www.grymoire.com/Unix/Sed.html (Look at the "s" command)
 
Old 10-05-2009, 01:14 AM   #3
lutusp
Member
 
Registered: Sep 2009
Distribution: Fedora
Posts: 835

Rep: Reputation: 102Reputation: 102
Quote:
Originally Posted by magicstyle View Post
how do I replace all occurences of

><

with

>
<

?


thank you
Since this is almost certainly homework, I will say that you need to insert a linefeed between the two characters, and you can do it with a very simple Bash script.
 
Old 10-06-2009, 03:55 AM   #4
nilocj.d
LQ Newbie
 
Registered: Sep 2009
Location: Sheffield, UK
Distribution: Debian
Posts: 5

Rep: Reputation: 0
A cheat is to use rpl (not installed on a lot of linux distributions by default) but you still have to insert a linefeed between the characters.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
using sed to replace text on one line in a text file vo1pwf Linux - Newbie 5 06-24-2009 08:54 AM
bash script to create text in a file or replace value of text if already exists knightto Linux - Newbie 5 09-11-2008 12:13 AM
how to replace text from to ? graziano1968 Linux - General 2 08-02-2006 07:14 AM
Replace text of unknown content with other text in file brian0918 Programming 15 07-14-2005 10:22 PM
Replace text of unknown content with other text in file brian0918 Linux - Software 1 07-14-2005 04:22 PM


All times are GMT -5. The time now is 02:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration