|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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. |
#2
|
||||
|
||||
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] |
#3
|
|||
|
|||
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. |
#4
|
||||
|
||||
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] |
#5
|
|||
|
|||
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 :-}
|
#6
|
|||
|
|||
Quote:
PERFECT! This does EXACTLY what I want! Incredibly simple. Thank you! |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
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 |