At 10:37 -0700 5/7/10, Warren Michelsen wrote:
...I'm guessing that Perl is the best tool for this job. It has a
reverse function so I'm guessing that the original selection could
be read into an array, using "<tr" and "/tr>" as delimiters, then
regurgitated in reverse order of the original.
How you do it will depend on where your line-breaks are. If your file reads
<tr>1</tr>
<tr>2</tr>
<tr>3</tr>
<tr>4</tr>
<tr>5</tr>
then it is simple. Just write the following little routine, select
the lines in the document you want to reverse and run the script.
#UNIX SCRIPT:
while (<>) {
chomp;
push @_, $_
}
for (reverse @_){
next if /^$/; # ignore blank lines
print "$_\n";
};
Run the above script from the palette or with a key-shortcut to get:
<tr>5</tr>
<tr>4</tr>
<tr>3</tr>
<tr>2</tr>
<tr>1</tr>
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
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 "[email protected]" rather than posting to the group.