How does one automate removing trailing spaces in a text field in a table? If the answer is use a Basic script, can you point me to something that would serve as an example? For reference, I am quite familiar with VBA in Excel.
As an example where I ended up with trailing spaces, I populated a Base table from a spreadsheet with integer numbers in one column (tree tag numbers). I chose Integer as the field type. Later, I joined this field to another that had numbers as text, in a different table. The join failed, because of the different data types. So I edited the table and changed from Integer to Text. Doing that I ended up with trailing spaces. Those trailing spaces caused join problems as well. To fix this, I copied the table, pasted it into Calc, and from there pasted back into Base, this time with that field as text. That got rid of the trailing spaces.
Why did I choose Integer as the field type, you might ask. If I chose to sort based upon that field, the result is “nicer” when that field is treated as an integer than when it is treated as text. Did I anticipate the join problems? No.
This experience makes me interested in how I might remove trailing spaces without leaving Base to do so. It might even motivate me to learn to use macros in Base.