NEED HELP-----Removing a space at the end of a string of character

F

FRS

I have spreadsheets with tens of thousands of fields containing data. All of
the data consists of a string of characters followed by a space. In the end
I need to save the spreadsheet in a .csv format, WITHOUT the space in each
field.

Can anyone suggest a quick way to do this? Your help is appreciated.
 
J

Jim May

In Excel there is a function TRIM()
example =trim(a1)
would eliminate any spaces before or after the text in a1.
HTH
 
K

Kevin B

The following suggestion assumes that the data is in Sheet 1, and starts at A1.

In Sheet 2, cell A1 insert the following formula:

=TRIM(Sheet1!A1)

Copy the formula down column A, as far down as the last row of data in Sheet
1. Then copy all of column A in Sheet 2 across as many columns as needed to
reference the entire data set in Sheet 1.

While still in sheet 2, press Ctrl + Shift + * to select the entire regions.
Copy the selected cells and then paste special as Values. You can then use
sheet 2 for your csv file source.
 
F

FRS

Appreciate all the help.

I tried the edit>replace as it seemed to be the easiest solution and put a
space in the Find What field and nothing in the Replace field. That did not
work. It only worked for the few fields in which there was no character
string and just a space.

Will proceed to try the other suggestions.

==========================================================
 
F

FRS

Am I doing something wrong with the edit>replace option?
=============================================
 
F

FRS

I tried this solution and ran the TRIM function from Sheet1 on to Sheet 2.
Did the copy and paste special as values. The sheet2 fields still show the
space at the end of the character strings.
====================================================
 
M

Mike Middleton

FRS -
Am I doing something wrong with the edit>replace option? <

Perhaps the "spaces" are really non-breaking spaces.

If so, in the "Find and Replace" dialog box, in the "Find what:" edit box,
hold down the Alt key and on the numeric keypad type 0160, and leave the
"Replace with:" edit box blank.

- Mike
www.mikemiddleton.com
 
Top