Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

do shell script- sed conundrum



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:
http://lists.apple.com/mailman/options/applescript-users/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.