Start the Open Office Calc, load your file, select the cells you want to change and follow these steps:
- Go in menu Edit > Find & Replace
- Search for: ^\s+|\s+$
- Replace with: empty
- Options/Regular expressions: ON
- Options/Current selection only: ON
- Click Replace All