That's brilliant! I had no idea the sort could be tinkered with using regular expressions. --
Allen Watson . Writer/Webmaster [ p. 503 .281 .0250 m. 503 .916 .9411 e. [EMAIL PROTECTED] homepage.mac.com/allen_a_watson/ > From: Patrick Woolsey <[EMAIL PROTECTED]> > Reply-To: BBEdit-Talk List <[email protected]> > Date: Mon, 18 Jun 2007 09:02:37 -0400 > To: BBEdit-Talk List <[email protected]> > Subject: Re: Sorting lines (urgent...) > > Andrew Brown <[EMAIL PROTECTED]> sez: > >> We have a few thousand lines like this >> >> Du Châtelet, Emilie >> Du Châtelet, Fred >> Du Châtelet, Gustave >> Duchâtelet, Emilie >> Duchâtelet, Fred >> Duchâtelet, Gustave >> >> When sorted with BBEdit, they come out in that order, but we want the >> space to be ignored to produce >> >> Du Châtelet, Emilie >> Duchâtelet, Emilie >> Du Châtelet, Fred >> Duchâtelet, Fred >> Duchâtelet, Gustave >> Du Châtelet, Gustave >> >> Can this be done? >> >> Are any characters ignored by the BBEdit sort? > > > By default, Sort Lines considers the whole content (character-by-character) > of each line. > > To make Sort Lines consider only portions of lines, you can specify a grep > pattern and set the 'Sort Using' criteria as appropriate. > > searching pattern: ^([\w]+)\s*(.+)$ > > Sort Using: All sub-patterns > > > Starting with this data: > > ==== > Du Châtelet, Emilie > Du Châtelet, Fred > Du Châtelet, Gustave > Duchâtelet, Emilie > Du châtelet, Fred > Duchâtelet, Gustave > ==== > > applying Sort Lines with the specified parameters will give: > > ==== > Duchâtelet, Emilie > Du Châtelet, Emilie > Du châtelet, Fred > Du Châtelet, Fred > Duchâtelet, Gustave > Du Châtelet, Gustave > ==== > > (Note that sorting remains case-sensitive so that last names which are > internally lower-case will sort ahead of those with internal upper-casing.) > > Does this fit the desired purpose? > > > Regards, > > Patrick Woolsey > == > Bare Bones Software, Inc. <http://www.barebones.com> > P.O. Box 1048, Bedford, MA 01730-1048 > > -- > ------------------------------------------------------------------ > Have a feature request? Not sure the software's working correctly? > If so, please send mail to <[EMAIL PROTECTED]>, not to the list. > List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml> > List archives: <http://www.listsearch.com/BBEditTalk.lasso> > To unsubscribe, send mail to: <[EMAIL PROTECTED]> > -- ------------------------------------------------------------------ Have a feature request? Not sure the software's working correctly? If so, please send mail to <[EMAIL PROTECTED]>, not to the list. List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml> List archives: <http://www.listsearch.com/BBEditTalk.lasso> To unsubscribe, send mail to: <[EMAIL PROTECTED]>
