Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-17-2016, 05:21 PM
tatihulot tatihulot is offline How do I Remove A Specific Amount of Characters from Lines in a Document? Windows 8 How do I Remove A Specific Amount of Characters from Lines in a Document? Office 2010 (Version 14.0)
Advanced Beginner
How do I Remove A Specific Amount of Characters from Lines in a Document?
 
Join Date: Apr 2010
Posts: 38
tatihulot is on a distinguished road
Default How do I Remove A Specific Amount of Characters from Lines in a Document?

Hello, everyone, I am using Word 2010.
I have a document with a list that looks like this:

Cyndi Lauper - Complete Discography
1980 - Blue Angel (reissue 2005)
1983 - She's So Unusual (CBS Inc. 07464-38930-2)
1984 - Live At The Summit (Houston'84)
1986 - True Colors (Japan edition)
1989 - A Night To Remember
1989 - The Best Remixes
1993 - Hat Full Of Stars
1993 – Who Let In The Rain (Epic – 659039 1 Single)
1994 - Twelve Deadly Cyns... And Then Some
1996 - Sisters Of Avalon
1998 - Merry Christmas...Have A Nice Life
2000 - Time After Time (The Best Of)
2001 - Feels Like Christmas
2001 - Shine ( Epic Records)
2003 - At Last
2003 - Essential Cyndi Lauper
2004 - Shine (Japan)


2005 - Hey Now! (Remixes & Rarities))
2005 - The Body Acoustic
2006 - Collections
2007 - The Very Best Of (Expanded edition)
2008 - Bring Ya To The Brink
2008 - Greatest Hits (Steel Box Collection)
2008 - Into The Nightlife (remixes)
2009 - Floor Remixes
2009 - Playlist... The Very Best of Cyndi Lauper
2010 - Memphis Blues
2010 - Memphis Blues (Brazil Edition)
2011 - To Memphis, With Love

I want to remove the date and the dash from the beginning of each line in the list. Actually, I want to remove the date, the space before the dash, the dash itself, and the space after the dash. The first seven spaces from each line in this list.

So, the end result would look like this:
Blue Angel (reissue 2005)
She's So Unusual (CBS Inc. 07464-38930-2)
Live At The Summit (Houston'84)
etc.

I assume I use the Replace option for this. Am I correct? If I am, where do I go from there? How do I do this for ONLY the list, and not the rest of the document?

Thank you! Jack D.
Reply With Quote
  #2  
Old 01-17-2016, 08:18 PM
macropod's Avatar
macropod macropod is offline How do I Remove A Specific Amount of Characters from Lines in a Document? Windows 7 64bit How do I Remove A Specific Amount of Characters from Lines in a Document? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
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

You can do this with an ordinary Find/Replace, where:
Find = ^#^#^#^#^w-^w
Replace = nothing

If you only want to process a particular range, select it beforehand and answer 'No' when prompted to search the rest of the document.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 01-18-2016, 05:28 AM
tatihulot tatihulot is offline How do I Remove A Specific Amount of Characters from Lines in a Document? Windows 8 How do I Remove A Specific Amount of Characters from Lines in a Document? Office 2010 (Version 14.0)
Advanced Beginner
How do I Remove A Specific Amount of Characters from Lines in a Document?
 
Join Date: Apr 2010
Posts: 38
tatihulot is on a distinguished road
Default

Thank you for replying. I eventually realized I could probably record a macro that removes specific text strings and specific characters. After dabbling with a few test macros, I got one that did precisely what I wanted.

Why I didn't think of macros before posting the question, I don't know. But I do appreciate you taking the time to reply. Jack D.
Reply With Quote
  #4  
Old 01-18-2016, 07:59 PM
macropod's Avatar
macropod macropod is offline How do I Remove A Specific Amount of Characters from Lines in a Document? Windows 7 64bit How do I Remove A Specific Amount of Characters from Lines in a Document? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
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

But, as my reply showed, you don't need a macro...

Without seeing your recorded macro, I can confidently say it wouldn't be as efficient as:
Code:
Sub Demo()
Application.ScreenUpdating = False
With ActiveDocument.Range
  With .Find
    .ClearFormatting
    .Replacement.ClearFormatting
    .Text = "^#^#^#^#^w-^w"
    .Replacement.Text = ""
    .Forward = True
    .Wrap = wdFindContinue
    .Format = False
    .MatchWildcards = False
    .Execute Replace:=wdReplaceAll
  End With
End With
Application.ScreenUpdating = True
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 01-19-2016, 01:56 AM
eNGiNe eNGiNe is offline How do I Remove A Specific Amount of Characters from Lines in a Document? Windows 7 32bit How do I Remove A Specific Amount of Characters from Lines in a Document? Office 2010 64bit
Expert
 
Join Date: Jan 2012
Location: Brussels [BE]
Posts: 746
eNGiNe is on a distinguished road
Default

This triggered vague memories – so I checked, and for something like this (where the text you want to select mines up quite neatly) you can use Alt + mouse to select a vertical block and then delete the selection as usual. At least as quick as setting up a regular expression find/replace :-}
Reply With Quote
  #6  
Old 01-22-2016, 05:55 AM
tatihulot tatihulot is offline How do I Remove A Specific Amount of Characters from Lines in a Document? Windows 8 How do I Remove A Specific Amount of Characters from Lines in a Document? Office 2010 (Version 14.0)
Advanced Beginner
How do I Remove A Specific Amount of Characters from Lines in a Document?
 
Join Date: Apr 2010
Posts: 38
tatihulot is on a distinguished road
Default

Quote:
This triggered vague memories – so I checked, and for something like this (where the text you want to select mines up quite neatly) you can use Alt + mouse to select a vertical block and then delete the selection as usual. At least as quick as setting up a regular expression find/replace :-}

PERFECT! This does EXACTLY what I want!

Incredibly simple. Thank you!
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I Remove A Specific Amount of Characters from Lines in a Document? Amount of specific word Stimo Word 1 09-17-2015 08:15 PM
hard lines across document - can't remove joanieS Word 3 07-30-2013 11:29 AM
How to remove these unknown characters appearing rajpes Word 1 03-02-2012 03:24 AM
Outlook 2007 - Notifications if emails are unread after a specific amount of time? Robb Outlook 0 12-10-2010 11:18 AM
Force Kiosk published PPT to return to a specific slide after x amount of minutes jasoomian PowerPoint 1 07-31-2010 03:09 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:22 AM.


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