How to trim starting spaces of entire column in LibreOffice or Google sheets?

11,107

Solution 1

In LibreOffice:
1. Select the cells you want to change
2. Edit -> Find & Replace
3. Find: ^\s+
4. Replace:
5. Other Options - Regular expressions: ON
6. Other Options - Current selection only: ON
7. Click Replace All

Solution 2

I'm sure the other answer works, but if you just need to do it once, I have an easy option. Download Sublime Text or some other text editor. Look for spaces at the beginning of a string (using ("^ ") without quotes should do it), and erase them.

Text editors are really helpful for normalizing data like this when you don't need updates in the future.

Solution 3

In LibreOffice you can trim all spaces (beginning and end) via the "text to column" function:

Data -> "Text to Column"

Then assure the column is not being split (e.g. select tab als separator, if no tabs are present) and select "Trim spaces"

Share:
11,107
Atchyut Nagabhairava
Author by

Atchyut Nagabhairava

Experienced Software Engineer with a demonstrated history of working in the internet industry. Skilled in Ruby on Rails, Angular. Having an ability to understand the client requirements in detail and put the best of my knowledge and experience to bring the best shape for the product. Experience: Having experience in building website from scratch or to provide continuous maintenance and support for existing applications. Involved in developing complex websites includes writing background jobs, Generating activity stream of entire app functionality, Using API to get information from Github, Bitbucket, Google maps. Developed a speech recognition voice based functional bot. Wrote web scraping scripts using Nokogiri and Mechanize. Added support for an existing ROR application with NoSQL database. Worked in a team to build an application with Angular front-end and ROR back-end. My areas of expertise include: Programming languages: Ruby, Python Frameworks: RubyOnRails, React.js UI/UX: HTML5, Bootstrap, CSS3, SASS, jQuery, coffeescript , Ajax. Database Administration: MySQL, PostgreSQL, MongoDB TDD/BDD: RSpec, Capybara, FactoryGirl, Tools: JIRA / Confluence, Toggl, Slack, VS code Version Control: Github, Bitbucket Deployment & tools: nginx, Heroku API: Facebook, Github, Bitbucket, Google Maps.

Updated on June 15, 2022

Comments

  • Atchyut Nagabhairava
    Atchyut Nagabhairava almost 2 years

    I'm a bit of a newbie at this, so hope to get some help.

    I have a large spreadsheet where columns C and D each have a blank space before the data in each column. Can some one please explain me how to trim an entire column to remove starting spaces in LibreOffice of Google Spreadsheets