On 2006-10-17, at 17:38, [EMAIL PROTECTED] wrote:

I'm looking for an easy way to total a column of numbers in a fragment of a
large text file. Normally I copy the text file into BBEdit, use
option-select to select just the column of numbers, and then I paste them
into Excel where I type in a formula to sum everything up.

Does anyone know of a way that I could possibly sum the numbers right within
BBEdit, after selecting the column? Would this be easy to do with
AppleScript?

Easy-ish:

tell application "BBEdit"
        tell front window
                set l to 0
                repeat with p in paragraphs of (get selection as text)
                        try
                                set l to l + p
                        end try
                end repeat
        end tell
end tell

?

pete

--
------------------------------------------------------------------
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]>

Reply via email to