On Tue, Dec 18, 2007 at 03:36:50PM -0500, Bill Metzinger wrote:
> hi all
> I'm using the following match pattern in applescripts to sort lines
> of tab delimited text
>
> {match pattern:"^([^ ]* ){3}(.*)$", sort subpattern
> key:all_subpatterns}
> {match pattern:"^([^ ]* ){7}(.*)$", sort subpattern
> key:all_subpatterns}
>
>
> it works wonderfully to sort by the 3rd column or 7th column or
> whatever number indicated
> this fails to sort when my text only has 3 columns and I ask to sort
> the third column
>
> my question
> how can I change the pattern to sort the third column even if it's
> the last column?
This might work for you:
^([^\t\n]*(?:\t|$)){3}(.*)$
(I expect you'll need to escape the backslashes for AppleScript.)
Ronald
--
------------------------------------------------------------------------
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_script.shtml>
List archives: <http://www.listsearch.com/bbeditscripting.lasso>
To unsubscribe, send mail to: <[EMAIL PROTECTED]>