Re: Multiple HTML tag selection and delete with BBEdit Mac
Nick— In case you don't know: the suggestions from Alex and Kendall use grep, which is a powerful way of finding characters that match specified patterns. To use it, you'll want to enter the pattern in the 'Find' dialog and make sure that the 'grep' box is checked. For more information on grep, which is one of BBEdit's most useful tools, read chapter 8 in the BBEdit manual, available from the Help menu. It gives quite a good introduction. gr. On Thu, Jun 3, 2010 at 7:31 AM, Kendall Conrad angelw...@gmail.com wrote: You'll want to make that less greedy (using *?) so it doesn't take out too much. You can also simplify by moving the /? outside the parentheses so it doesn't need to be repeated. /?(table|tr|td)[^]*? A little less readable, but we can move the 't' out as well. /?t(able|r|d)[^]*? -Kendall On Jun 3, 12:13 am, Alex Satrapa gr...@goldweb.com.au wrote: On 03/06/2010, at 10:39, Nick A nicholasalexanderad...@gmail.com wrote: I'm just smashing all the table tags so that I can keep his content and re-style it with CSS once all the tables are gone. How do I select all table,/table,tr,/tr,td and /td at once and delete them? Find (/?table|/?tr|/?td|/?tr)[^]* and replace with '' might work. Alex Satrapa | web.mac.com/alexsatrapa | Ph: 0407 705 332 -- 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.combbedit%2bunsubscr...@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. -- 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.
Re: Multiple HTML tag selection and delete with BBEdit Mac
On Thu, Jun 03, 2010 at 04:31:03AM -0700, Kendall Conrad wrote: You'll want to make that less greedy (using *?) so it doesn't take out too much. You can also simplify by moving the /? outside the parentheses so it doesn't need to be repeated. /?(table|tr|td)[^]*? There is no need to use a non-greedy quantifier in this particular pattern. [^]* and [^]*? are completely equivalent in what they will match. Either way, you're matching exactly as many non- characters as there are up to the first character. Ronald -- 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.
Re: Multiple HTML tag selection and delete with BBEdit Mac
I've looked into it a bit more and I've realized that I'm going to need to get good at regular expressions to become a half-way decent worker; they seem really powerful for automating monotonous tasks and working quickly. Thanks for pointing me that way. I tried Alex's suggestion and it picked up all the table,/ table,tr,/tr,td and /td tags without picking up any others, so it worked well. Now I'm stuck with a search window that lists all the tags that were found, but I don't know how to delete them all. Intuitively I want to select all and delete, but it doesn't seem to work like that. Using the find/find all/replace dialog box doesn't seem to be able to do it all at once. How do I do this all at once? Thanks everyone. I'll refer back to the more detailed GREP responses once I understand GREP a bit better. Nick On Jun 3, 6:12 am, Gabriel Roth gabe.r...@gmail.com wrote: Nick— In case you don't know: the suggestions from Alex and Kendall use grep, which is a powerful way of finding characters that match specified patterns. To use it, you'll want to enter the pattern in the 'Find' dialog and make sure that the 'grep' box is checked. For more information on grep, which is one of BBEdit's most useful tools, read chapter 8 in the BBEdit manual, available from the Help menu. It gives quite a good introduction. gr. On Thu, Jun 3, 2010 at 7:31 AM, Kendall Conrad angelw...@gmail.com wrote: You'll want to make that less greedy (using *?) so it doesn't take out too much. You can also simplify by moving the /? outside the parentheses so it doesn't need to be repeated. /?(table|tr|td)[^]*? A little less readable, but we can move the 't' out as well. /?t(able|r|d)[^]*? -Kendall On Jun 3, 12:13 am, Alex Satrapa gr...@goldweb.com.au wrote: On 03/06/2010, at 10:39, Nick A nicholasalexanderad...@gmail.com wrote: I'm just smashing all the table tags so that I can keep his content and re-style it with CSS once all the tables are gone. How do I select all table,/table,tr,/tr,td and /td at once and delete them? Find (/?table|/?tr|/?td|/?tr)[^]* and replace with '' might work. Alex Satrapa | web.mac.com/alexsatrapa | Ph: 0407 705 332 -- 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.combbedit%2bunsubscr...@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. -- 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.
Re: Multiple HTML tag selection and delete with BBEdit Mac
On Thu, Jun 03, 2010 at 09:10:39AM -0700, Nick A wrote: I tried Alex's suggestion and it picked up all the table,/ table,tr,/tr,td and /td tags without picking up any others, so it worked well. Now I'm stuck with a search window that lists all the tags that were found, but I don't know how to delete them all. Intuitively I want to select all and delete, but it doesn't seem to work like that. Using the find/find all/replace dialog box doesn't seem to be able to do it all at once. How do I do this all at once? Thanks everyone. I'll refer back to the more detailed GREP responses once I understand GREP a bit better. Just do a Replace All with the pattern in the Find field and nothing in the Replace field. Ronald -- 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.
Re: Multiple HTML tag selection and delete with BBEdit Mac
At 9:10 AM -0700 on 06/03/2010, Nick A wrote about Re: Multiple HTML tag selection and delete with BBEdit Mac: Now I'm stuck with a search window that lists all the tags that were found, but I don't know how to delete them all. Intuitively I want to select all and delete, but it doesn't seem to work like that. Using the find/find all/replace dialog box doesn't seem to be able to do it all at once. How do I do this all at once? Thanks everyone. I'll refer back to the more detailed GREP responses once I understand GREP a bit better. I assume that you did a find to test the search. All you need to do to actually delete them is to change your request from a find to a find/replace and place a space in the replace box. This will remove the tags and place a space where they were. -- 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.
Re: Multiple HTML tag selection and delete with BBEdit Mac
On 2010-06-03, Nick A wrote: Now I'm stuck with a search window that lists all the tags that were found, but I don't know how to delete them all. Intuitively I want to select all and delete, but it doesn't seem to work like that. Using the find/find all/replace dialog box doesn't seem to be able to do it all at once. How do I do this all at once? You need to study BBEdit more. There (of course) is a Replace All command. BUT before you do that... What people have been suggesting is using the search pattern for the table element markup and replacing each instance with '' -- nothing. Before you do that, you might consider replacing table element markup with some easily identifiable character(s), allowing you to more easily see where the former table markup was, and also use additional find/replace steps to begin putting your non-table markup/css in place. If I were dismantling tables with this brute force I have to do it fast approach, perhaps not knowing for sure yet exactly how the contents of the tables will be marked up in the new version, I would at least throw in some white space. Something like replacing table tags with two blank lines, tr tags with one blank line, and td th tags with a newline and a tab (\r\t). That would at least let me see the what was left in separate pieces. You could just as easily replace table tags with div tags, tr tags with p, and td th with span. Taking this further, try: replace table tags with div class=former_table replace tr tags with p class=former_row replace th tages with span class=former_heading replace td tags with span class=former_cell You're not stuck forever with those classes named former... -- you can always do find/replace on them once the stuff being marked up is integrated with your new css/markup scheme. In the meantime, though, you have every piece of the former table's content marked up with style-able structures. But this really depends on whether the table's organization of its contents maps closely to how you want to organize the content in the new version. It probably won't map well, and you'll have to do some hand work rearranging the content to work with css layout. Then I think your job is simpler if you do something like what I've suggested in above with white space. HTH - Bruce _bruce__van_allen__santa_cruz_ca_ -- 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.
Re: Multiple HTML tag selection and delete with BBEdit Mac
On Thu, Jun 3, 2010 at 12:41 PM, Bruce Van Allen b...@cruzio.com wrote: You need to study BBEdit more. There (of course) is a Replace All command. BUT before you do that... What people have been suggesting is using the search pattern for the table element markup and replacing each instance with '' -- nothing. Before you do that, you might consider replacing table element markup with some easily identifiable character(s), allowing you to more easily see where the former table markup was, and also use additional find/replace steps to begin putting your non-table markup/css in place. That is an EXCELLENT suggestion, Bruce! +1 -- 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.
Re: Multiple HTML tag selection and delete with BBEdit Mac
On 04/06/2010, at 2:10, Nick A nicholasalexanderad...@gmail.com wrote: I've looked into it a bit more and I've realized that I'm going to need to get good at regular expressions to become a half-way decent worker; they seem really powerful for automating monotonous tasks and working quickly. Thanks for pointing me that way. I recommend Mastering Regular Expressions - http://oreilly.com/catalog/9781565922570 Alex Satrapa | web.mac.com/alexsatrapa | Ph: +61 407 705 332 -- 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.