MS Word Macro to combine duplicate headings

  • Thread starter Mo007 via OfficeKB.com
  • Start date
M

Mo007 via OfficeKB.com

I have a long list of records such as contained in the following short
example:
Each item begins e.g., Record number: 1, Record number 2
Each item ends with a unique sys.no. e.g. sys.no. 002286060

I am successfully transposing this into a set of records in MS Access.

The problem I have is that the heading of some items is repeated – e.g.,
ISBN 9781933495057
ISBN 1933495057

Could someone possibly write a macro that I could adapt to join e.g., all the
ISBN data in one line / sentence. The heading in each case –ISBN – only
needs to be stated once.

Since I have many thousands of such records to transpose a shove in the right
direction would be immensely appreciated. I would then write a similar macro
to cover all the other duplicated headings. Thanks

Record number : 15
Format BK
LC Control No. 2006033696
ISBN 9781933495057
ISBN 1933495057
LC Call No. BV 4832.3 .M47 2007
Dewey Decimal Call 242/.2 22
ME-Personal Name Merton, Thomas, 1915-1968.
Title A book of hours / Thomas Merton ; edited by Kathleen
Deignan ; illustrations by John Giuliani ; with a foreword by Jim Finley.
Pub. Dist., etc. (I Notre Dame, IN : Sorin Books, 2007.
Sys.No. 002261762

Record number : 16
Format BK
LC Control No. 85023864 //r92
ISBN 0814604064 (pbk.)
ISBN 0800619129 (Fortress Press : pbk.)
LC Call No. BS1430.2 .M445 1986
Dewey Decimal Call 248.3 19
ME-Personal Name Merton, Thomas, 1915-1968.
Title Bread in the wilderness / Thomas Merton.
Phys.Description 179 p. ; 18 cm.
Bibliography Note Bibliography: p. 174-179.##
Sys.No. 001337151
 
D

Doug Robbins - Word MVP

You can do this using a Wildcard Edit>Replace with

([ISBN ]{1,})([0-9]{1,})^13([ISBN ]{1,})([0-9]{1,})^13

in the Find what control and

\1\2\4

in the Replace with control

I am not sure what is separating the ISBN from the first digit of the
number, but in the above, I have assumed that it is an ordinary space.

If that is not what it is, replace the space after the N of ISBN in both
places above with whatever character that is.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top