On 2006-08-05, at 16:27, David Livesay wrote:
Or a scripting language such as AppleScript. Or a scripting
language such as Python. I've been able to get through life without
ever having to resort to Perl.
It's a good idea to learn AppleScript if you're a Mac user and use
Mac applications. If you work with text much, regular expressions are
pretty useful. You can also use these with AppleScript if you use an
add-on such as SATImage or TextCommands, and with BBEdit of course.
Sometimes it's useful to have another language in your toolbox: Ruby
and Python are good choices (perhaps Ruby is slightly better for
beginners - at least I found it so), and Perl is still fairly
ubiquitous, and many people swear by it. Underneath the surface, for
this type of work at least, most of the scripting languages will do
the job for you well, and you could choose one that suits your way of
thinking and your personal taste. I like the following language -
here's my version of Matthew's Perl script:
#!/usr/bin/newlisp
(set 'file (open ((main-args) 2) "read"))
(while (read-line file)
(set 'n (find {(\s)(\d+)(\s)(.*)} (current-line) 0))
(if n
(println (current-line))
(println $1 (int $2) $3 $4)))
:-)
--
------------------------------------------------------------------
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]>