Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-07-2012, 06:49 AM
konopca konopca is offline Directory dump cleanup Windows XP Directory dump cleanup Office 2003
Novice
Directory dump cleanup
 
Join Date: Apr 2011
Posts: 27
konopca is on a distinguished road
Default Directory dump cleanup

My file contains file path and document name info from our work folder and subfolders.



Using search and replace how would I delete the file path info, that is, the "K:\" and everything else up to and including the last "\" in each paragraph (leaving only the file name info).

Is there a way to do this?

Carol
Reply With Quote
  #2  
Old 06-07-2012, 07:22 PM
macropod's Avatar
macropod macropod is online now Directory dump cleanup Windows 7 64bit Directory dump cleanup Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi Carol,

A simple Find/Replace should be able to handle that - simply input the complete path as the Find expression and leave the Replace expression empty.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 06-08-2012, 03:14 AM
konopca konopca is offline Directory dump cleanup Windows XP Directory dump cleanup Office 2003
Novice
Directory dump cleanup
 
Join Date: Apr 2011
Posts: 27
konopca is on a distinguished road
Default

Macropod
That would work for half of the file path, our directory structure contains many folders and subfolders. I have several pages to clean up on a monthly basis -- was just thinking there would be a way to find and delete from the start of the line to the last backward slash in the line. Perhaps not.
Thanks anyway.
Carol
Reply With Quote
  #4  
Old 06-08-2012, 10:46 PM
macropod's Avatar
macropod macropod is online now Directory dump cleanup Windows 7 64bit Directory dump cleanup Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Given that the folder paths are different, you could try a wildcard Find/Replace, where:
Find = (*)([A-Za-z0-9 ._\-\(\)\[\]\{\}]{1,}^13)
Replace = \2

There may be some other valid filename characters that the Find expression doesn't cover, but you can add them easily enough.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 06-11-2012, 03:23 AM
konopca konopca is offline Directory dump cleanup Windows XP Directory dump cleanup Office 2003
Novice
Directory dump cleanup
 
Join Date: Apr 2011
Posts: 27
konopca is on a distinguished road
Default

Macropod
Thank you for your help. This search and replace worked on some lines and not others (maybe because my file names contained hyphens, don't know).
But anyway I should have requested that this thread be closed because I found a solution in the Excel forum in an existing post titled word up to last "\"
Carol
Reply With Quote
  #6  
Old 06-11-2012, 04:08 AM
macropod's Avatar
macropod macropod is online now Directory dump cleanup Windows 7 64bit Directory dump cleanup Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi Carol,

The Find/Replace expression caters for hyphens, so it's probably some other character that I hadn't catered for.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #7  
Old 06-11-2012, 04:41 AM
konopca konopca is offline Directory dump cleanup Windows XP Directory dump cleanup Office 2003
Novice
Directory dump cleanup
 
Join Date: Apr 2011
Posts: 27
konopca is on a distinguished road
Default

Okay, I see. turns out there were lots of them: open & close parenthesis, apostrophy, ampersand. Probably better to use the Excel solution. Since I have no control over what folks are naming the files.
Reply With Quote
  #8  
Old 06-11-2012, 04:45 AM
macropod's Avatar
macropod macropod is online now Directory dump cleanup Windows 7 64bit Directory dump cleanup Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Parentheses, braces & square brackets are all catered for, but ampersands were not. As I said in the post, you could easily add additional characters to the Find expression if you need them (in this case \&)
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #9  
Old 06-11-2012, 05:21 AM
konopca konopca is offline Directory dump cleanup Windows XP Directory dump cleanup Office 2003
Novice
Directory dump cleanup
 
Join Date: Apr 2011
Posts: 27
konopca is on a distinguished road
Default

Alright I added a few more, the plus sign and comma. I will keep this in my personal folder for future use. It will be easier than copying and pasting to Excel. Thank you.
Reply With Quote
  #10  
Old 06-11-2012, 08:12 PM
macropod's Avatar
macropod macropod is online now Directory dump cleanup Windows 7 64bit Directory dump cleanup Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

If you're going to be doing a lot of this (and, from what you've posted, it seems likely), record the Find/Replace as a macro, which you can then call via Alt-F8 or even via a keyboard shortcut. It'll save a lot of time and be less error-prone than trying to replicate it each time.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #11  
Old 06-12-2012, 02:52 AM
konopca konopca is offline Directory dump cleanup Windows XP Directory dump cleanup Office 2003
Novice
Directory dump cleanup
 
Join Date: Apr 2011
Posts: 27
konopca is on a distinguished road
Default

That's a good idea, will do.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Outlook 2010 & Redundant Files Cleanup goombarok Outlook 0 03-09-2012 08:04 AM
Directory dump cleanup Directory Mailmerge rohitjain80 Mail Merge 1 02-12-2012 03:42 AM
Cleanup Feature mlocy Outlook 0 01-25-2012 09:06 AM
Active Directory ababc Misc 0 09-19-2006 06:18 AM
Active Directory nukkumatti Misc 0 11-16-2005 08:42 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:03 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft