clear extra spaces and tabs in a file

Any help appreciated
Thanks

sample input:

>         (extra spaces&tabs in here)       test1            (extra spaces&tabs in here)                         123.123.123.123       (extra spaces&tabs in here)          abc (extra spaces&tabs in here)   123
---
<         (extra spaces&tabs in here)         test2              (extra spaces&tabs in here)                       345.345.345.345        (extra spaces&tabs in here)        def  (extra spaces&tabs in here)   345

needed output:

> test1 123.123.123 abc 123
---
< test2 345.345.345 def 345
ruby -i.bak -ne 'print if gsub(/\s{2,}|^ +| +$/,"")' file1
awk '$1=$1' infile

superb Scrutinizer

Thank you very much