At 12:48 PM -0700 on 7/5/10, Bill Rowe wrote about Re: Flip a Table:
On 7/5/10 at 10:37 AM, [email protected] (Warren Michelsen) wrote:
I have tables containing data in reverse chronological order. I'd
like it to be chronological so I'm thinking I can just move the
table rows around.
Seems like it would require a separate scratch file to hold the
re-ordered rows until all rows have been copied, then replace the
selection with the re-ordered rows.
This can be done in BBEdit with out a separate scratch file as follows:
Go to Text->Add/Remove Line Numbers...
Add suitable line numbers to the lines you want to reverse the order
of with a space between the line number and data you want retained.
Then to to Text->Sort Lines...
Select Numbers match by value and Reverse sort. Finally go back to
Add/Remove Line Numbers... to remove the line numbers previously
added.
The result will be a reverse order of the data.
This would work BUT first you would need to make sure that each row
(from <tr> to </tr>) is a single line of HTML. If the row is spread
over more than one line of HTML, the sort will not produce the
correct order. The simplest way of doing this is to highlight the
section of code that represents the rows, use format=compact to make
all of it a single line, and then do a find/replace of the section to
add new line codes (\r) after each </tr>. IOW: Find "</tr>" and
replace with "</tr>\r".
--
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.