Deleting spaces at end of line

R

Russ Cook

Hi All,
New to the forum, just signed up because I have a glitch with Word that has
completely puzzled me.

I have produced a list of file names that are held in a folder (using
right-drag, paste as hyperlink into Word doc). I then used "find and replace"
to delete all of the unwanted file path info and to just leave the file name.

I plan to use what is left in an Excel Spreadsheet as source data for a
VLOOKUP to see whether the file exists, but have found that the list in Word
has a "Space" at the end of every line and each line is treated as a
paragraph.

The problem comes when I paste this list into Excel and it treats the
"Space" as a character and therefore my VLOOKUP fails.

So, is there an easy way to delete all of the additional spaces at the end
of each line (approx 3500 lines of file-names)?

Assitance is very much appreciated.
 
H

Henk57

Russ said:
Hi All,
New to the forum, just signed up because I have a glitch with Word tha
has
completely puzzled me.

I have produced a list of file names that are held in a folder (using
right-drag, paste as hyperlink into Word doc). I then used "find an
replace"
to delete all of the unwanted file path info and to just leave the fil
name.

I plan to use what is left in an Excel Spreadsheet as source data for

VLOOKUP to see whether the file exists, but have found that the list i
Word
has a "Space" at the end of every line and each line is treated as a
paragraph.

The problem comes when I paste this list into Excel and it treats the
"Space" as a character and therefore my VLOOKUP fails.

So, is there an easy way to delete all of the additional spaces at th
end
of each line (approx 3500 lines of file-names)?

Assitance is very much appreciated.

I am not sure if I understand all your fiddling, but .... If you ar
sure that none of the file names have spaces included you can replac
these spaces by nothing. However, it's probably easiest to "repair
the names in Excel, using text functions (e.g. TRIM, that removes al
trailing spaces if existing). You can nest them with VLOOKUP, or, as
prefer because it is easier to see what you'r doing and t
trouble-shoot if needed, first cleanup yr file name list. HT
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top