• 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
Re: Using 'sed' to alter file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using 'sed' to alter file


  • Subject: Re: Using 'sed' to alter file
  • From: Björn Lundin <email@hidden>
  • Date: Thu, 6 Apr 2006 22:31:53 +0200


6 apr 2006 kl. 20.38 skrev Mark J. Reed:

<comments removed>
undef $/;  
$_ = <>;
my ($before, $changeme, $after) = /\A(.*StringA)(.*)(StringB.*)\Z/sm;
$changeme =~ s/[^a-zA-Z0-9:]/-/g;
$_ = $before . $changeme . $after;
($before, $changeme, $after) = /\A(.*StringC[^\(]*\()([^\)]*)(\).*)\Z/sm;
$changeme =~ s/[^a-zA-Z0-9:]/-/g;
$_ = $before . $changeme . $after;
print;
</comments removed>

And people find Perl hard to read/understand ;-)
(I do not doubt it will work though)

/Björn


Björn Lundin

bnl at spray dot se



 _______________________________________________
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: Using 'sed' to alter file
      • From: Mark Walsh <email@hidden>
References: 
 >Using 'sed' to alter file (From: Mark Walsh <email@hidden>)
 >Re: Using 'sed' to alter file (From: "Mark J. Reed" <email@hidden>)

  • Prev by Date: Re: Do shell and ssh
  • Next by Date: Re: Using 'sed' to alter file
  • Previous by thread: Re: Using 'sed' to alter file
  • Next by thread: Re: Using 'sed' to alter file
  • Index(es):
    • Date
    • Thread