in reply to adding a column of integers
This ruby solution also deserves a mention as it doesn't slurp the file thanks to ruby iterators.
ruby -we 'puts $<.inject(0) {|a, x| a + x.to_i };'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: adding a column of integers
by ikegami (Patriarch) on Jun 26, 2006 at 18:30 UTC |