+ Reply to Thread
Results 1 to 6 of 6

Thread: Find and replace

  1. #1
    Registered User
    Join Date
    05-25-2010
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    26

    Find and replace

    I've got a word document with a large list of references of journal articles.
    It's in a form like

    ...
    CRDT- 2010/07/03 06:00
    PMCR- 2011/07/01
    AID - 83/1/51 [pii]
    AID - 10.4269/ajtmh.2010.09-0621 [doi]

    PST - ppublish
    SO - Am J Trop Med Hyg. 2010 Jul;83(1):51-5.

    PMID- 20578447
    OWN - NLM
    ..........

    CRDT- 2010/07/03 06:00
    PMCR- 2011/07/01
    AID - 83/1/51 [pii]
    AID - 10.4269/ajtmh.2010.09-0621 [doi]

    PST - ppublish
    SO - Am J Trop Med Hyg. 2010 Jul;83(1):51-5.
    .......

    I want to get rid of the "AID - XXXXXXXX [pii]" parts
    However if I do a find and replace for Find: (AID - )*\[pii\] then it will find the first "AID - 83/1/51 [pii]" fine but next it will select from the start of the "AID - 10.4269/ajtmh.2010.09-0621 [doi]" all the way to the end of the next "AID - 83/1/51 [pii]"

    So I need something to like limit the allowed number of characters of the wildcard or some similar solution...

    Cheers

  2. #2
    Forum Guru pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2010
    Posts
    5,160

    Re: Tricky find and replace problem

    Hi Snowtoad

    This should do the trick

    (AID*?)(pii?)
    regards pike

    If the solution helped please donate
    here to the RSPCA

    Sites worth visiting;

    J&R Solutions - royUK

    AJP Excel Information - Andy Pope

    Spreadsheet Toolbox

    VBA for smarties - snb

  3. #3
    Forum Guru pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2010
    Posts
    5,160

    Re: Tricky find and replace problem

    even better
    (AID*?)([!do])(pii?)
    not quite the same as reg exp but close enough
    regards pike

    If the solution helped please donate
    here to the RSPCA

    Sites worth visiting;

    J&R Solutions - royUK

    AJP Excel Information - Andy Pope

    Spreadsheet Toolbox

    VBA for smarties - snb

  4. #4
    Registered User
    Join Date
    05-25-2010
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    26

    Re: Tricky find and replace problem

    Quote Originally Posted by pike View Post
    even better
    (AID*?)([!do])(pii?)
    not quite the same as reg exp but close enough
    Thnaks Pike, I'll give that a go!

  5. #5
    Registered User
    Join Date
    05-25-2010
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    26

    Re: Find and replace

    Yeah those didn't seem to work, had the same effect as the ones I tried.. first selected what I wanted, then next it selected from the AID - XXXXXXXXX [doi] all the way to the next AID - XXXXXX [pii]

  6. #6
    Forum Guru pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2010
    Posts
    5,160

    Re: Find and replace

    Hi Snowtoad,
    They work with the work doc I had, can you attach your sample word doc?
    regards pike

    If the solution helped please donate
    here to the RSPCA

    Sites worth visiting;

    J&R Solutions - royUK

    AJP Excel Information - Andy Pope

    Spreadsheet Toolbox

    VBA for smarties - snb

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.2.0