• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
do shell script- sed conundrum
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

do shell script- sed conundrum


  • Subject: do shell script- sed conundrum
  • From: Jonathan Levi MD <email@hidden>
  • Date: Fri, 17 Feb 2006 23:47:10 -0500

On Fri, 17 Feb 2006 13:47:58 -0700, Gnarlodious <email@hidden> wrote:
Entity Eric Geoffroy spoke thus:

> Starting text
Title: King KongTitle: Godzilla
 > Title: Mothra

[...]
In general, sed is a linewise command and not well suited to multilines,
although there are ways around that limitation.


I think you can do it cleanly and compactly with sed, if you allow yourself tr:

tr '\r' '\n' < yourfile			|\
sed 's/\(.\)\(Title:\)/\1\n\2/g'	|\
tr '\n' '\r'

HTH,

Jonathan
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: do shell script- sed conundrum
      • From: Le Stang Jean-Baptiste <email@hidden>
  • Prev by Date: Re: Toggle Screensaver
  • Next by Date: Re: Toggle Screensaver
  • Previous by thread: Re: Applescript-users Digest, Vol 3, Issue 99
  • Next by thread: Re: do shell script- sed conundrum
  • Index(es):
    • Date
    • Thread