in reply to removing square brackets
ruby -ne 'puts$1if/(-?\d(?:\.\d+)?)/' < data > munged
Update: To everyone griping and downvoting because it's not a perl solution, if you just change five characters (not counting s/ruby/perl/) it is valid perl. Have to leave something for the people asking extremely trivial questions yet providing no code of their own to figure out on their own . . .
(Hint: you need one more command line flag and change one keyword name)
Update 2: Awww, someone spoiled the exercise for the reader.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: removing square brackets
by ikegami (Patriarch) on Oct 20, 2005 at 15:18 UTC |