[clue-tech] [spam?] text processing howto

David L. Anselmi anselmi at anselmi.us
Thu Oct 7 22:28:34 MDT 2010


Brian Gibson wrote:
> COMMAND:
> $ echo "this that1 that2 that3 theotherthing" | ruby -e 'puts
> STDIN.read.split().slice(1..-1).join(",").split(/,(?!.*,)/)'

That seems like more work than perl to me.

But while I was working on the perl I tried to use [1..-1] and it didn't work.  That's the second 
time something intuitive worked in ruby and not in perl.

I like ruby (but I live in the '90s so I don't use it).

Dave


More information about the clue-tech mailing list