At 00:19 -0500 3/3/12, Robert A. Rosenberg wrote:

I have two HTML files. One is a list that I want to use as links to the other file. Is there any way I can automatically edit the list file to create unique ids for the URL#id tag and corresponding id=tag in the other file?


Provided you have the same sequence in both files and no false positives, the following Text Filter will do the substitution in either file:


#!/usr/bin/perl
use strict;
my $i1 = 1; my $i2 = 1;
while (<>){
  s/(html#id)#/$1$i1/ and $i1++;
  s/(id="id)#/$1$i2/ and $i2++;
  print;
}

JD

--
You received this message because you are subscribed to the "BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at
<http://groups.google.com/group/bbedit?hl=en>
If you have a feature request or would like to report a problem, please email "supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>

Reply via email to