Replace with newline character
I have some very long sql queries that are stored in a single line with statements separated by a ; to get around a bug in a program I use that limits me to single line queries. When I need to make changes to the queries, I like to split them out into multiple lines to make them readable. Most text editors allow me to do a find and replace to replace ';' with ';\n' to split them out. BBEdit just inserts a literal '\n' in place of a new line, even when I have the grep button clicked. Is there another way to use a new line as a replacement character? Thanks, Michael -- Michael Weisman -- 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
Re: Replace with newline character
You can type option-return in the replace box after the semi-colon. Find: ; Replace ; option-return On Sep 30, 2011, at 9:40 AM, mweisman wrote: I have some very long sql queries that are stored in a single line with statements separated by a ; to get around a bug in a program I use that limits me to single line queries. When I need to make changes to the queries, I like to split them out into multiple lines to make them readable. Most text editors allow me to do a find and replace to replace ';' with ';\n' to split them out. BBEdit just inserts a literal '\n' in place of a new line, even when I have the grep button clicked. Is there another way to use a new line as a replacement character? Thanks, Michael -- Michael Weisman -- 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
Re: Replace with newline character
On Sep 30, 2011, at 9:40 AM, mweisman wrote: I have some very long sql queries that are stored in a single line with statements separated by a ; to get around a bug in a program I use that limits me to single line queries. When I need to make changes to the queries, I like to split them out into multiple lines to make them readable. Most text editors allow me to do a find and replace to replace ';' with ';\n' to split them out. BBEdit just inserts a literal '\n' in place of a new line, even when I have the grep button clicked. Is there another way to use a new line as a replacement character? Strange, I do, we all do, what you're describing all the time and it works fine. BBEdit recognizes \n as a newline in search/replace. You could also try \r or just copy a newline from a text document and paste it in. [fletcher] -- 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
Re: Replace with newline character
At 09:49 -0700 9/30/11, Fletcher Sandbeck wrote: Remember that bbedit works with everything as 16 bit unicode. There, all line ends are Apple style 000D entries. Regardless of what will come out on a save you have to check for 0D while it's in memory. It was once true that, for Apple machines, 熟, with an OPTION d greek delta as the escape character, was 0D. Sometime, about when the neXt folks took over, the delta became a \ for the escape as in UNIX and you need to use \r in memory for new versions of bbedit. So search for \r and replace with ;\r in memory. bbedit will honor your choice of \n = 0A when saving the file. What happens with the other two 16 bit line ends in unicode is undetermined. -- Applescript syntax is like English spelling: Roughly, though not thoroughly, thought through. -- 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
Re: Replace with newline character
On Sep 30, 2011, at 11:40 AM, mweisman wrote: I have some very long sql queries that are stored in a single line with statements separated by a ; to get around a bug in a program I use that limits me to single line queries. When I need to make changes to the queries, I like to split them out into multiple lines to make them readable. Most text editors allow me to do a find and replace to replace ';' with ';\n' to split them out. BBEdit just inserts a literal '\n' in place of a new line, even when I have the grep button clicked. Is there another way to use a new line as a replacement character? Use '\r' in your search. If your file is Unix text (or saved as such) it will be saved as a newline ('\n'). BBEdit's '\r' convention took some getting used to when I switched to the Mac. I assume it is a holdover from the classic Mac days, where text files were carriage-return delimited. -- Rod Buchanan -- 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