A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » Formatting Long Documents
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Deleting spaces at end of line/paragraph



 
 
Thread Tools Display Modes
  #1  
Old December 20th, 2007, 10:40 AM posted to microsoft.public.word.formatting.longdocs
Russ Cook[_2_]
external usenet poster
 
Posts: 2
Default Deleting spaces at end of line/paragraph

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.

  #2  
Old December 20th, 2007, 01:24 PM posted to microsoft.public.word.formatting.longdocs
DeanH
external usenet poster
 
Posts: 1,783
Default Deleting spaces at end of line/paragraph

Use Find/Replace (Ctrl+H), Find for "[space]^p" that is Spacebar followed by
Shift+6 followed by lowercase p.
Replace with ^p
The ^p is the code for the paragraph marks.
Repeat this until you get 0 changes.
Hope this helps
DeanH


"Russ Cook" wrote:

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.

  #3  
Old December 20th, 2007, 01:50 PM posted to microsoft.public.word.formatting.longdocs
Russ Cook[_2_]
external usenet poster
 
Posts: 2
Default Deleting spaces at end of line/paragraph

DeanH - Genius ! That's exactly the trick....and far more simple than I
realised.
Huge thanks!

"DeanH" wrote:

Use Find/Replace (Ctrl+H), Find for "[space]^p" that is Spacebar followed by
Shift+6 followed by lowercase p.
Replace with ^p
The ^p is the code for the paragraph marks.
Repeat this until you get 0 changes.
Hope this helps
DeanH


"Russ Cook" wrote:

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.

  #4  
Old December 20th, 2007, 01:59 PM posted to microsoft.public.word.formatting.longdocs
DeanH
external usenet poster
 
Posts: 1,783
Default Deleting spaces at end of line/paragraph

You are most welcome.
DeanH

"Russ Cook" wrote:

DeanH - Genius ! That's exactly the trick....and far more simple than I
realised.
Huge thanks!

"DeanH" wrote:

Use Find/Replace (Ctrl+H), Find for "[space]^p" that is Spacebar followed by
Shift+6 followed by lowercase p.
Replace with ^p
The ^p is the code for the paragraph marks.
Repeat this until you get 0 changes.
Hope this helps
DeanH


"Russ Cook" wrote:

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.

  #5  
Old December 21st, 2007, 04:22 PM
Henk57 Henk57 is offline
Senior Member
 
First recorded activity by OfficeFrustration: Oct 2006
Posts: 387
Send a message via Skype™ to Henk57
Default

Quote:
Originally Posted by DeanH View Post
You are most welcome.
DeanH

"Russ Cook" wrote:

DeanH - Genius ! That's exactly the trick....and far more simple than I
realised.
Huge thanks!

"DeanH" wrote:

Use Find/Replace (Ctrl+H), Find for "[space]^p" that is Spacebar followed by
Shift+6 followed by lowercase p.
Replace with ^p
The ^p is the code for the paragraph marks.
Repeat this until you get 0 changes.
Hope this helps
DeanH


"Russ Cook" wrote:

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.
Oops, you posted twice Russ, and I just discovered after I answered. See my reply there - if you r still interested. Dean's answer is ok from a Word pov, but I think doing it in Excel allows you to build it in. And if your file name has spaces in them, these spaces will also be replaced by Dean's Ctrl-H. (Sorry Dean, it's not my intention to push you down)
__________________
Henk van Ekelenburg
co-author of the eBook "Mastering Microsoft Word for Scientific Reports" (and other long documents)
www.masteringword.eu/?Off
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:56 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.