3 Replies Latest reply on Aug 11, 2017 10:06 AM by Test Screen Name

    Add hyphens to ISBN number

    fraiquin

      Hi, I have a catalogue with 13 digit ISBN numbers in the following format: 9781107000000

       

      but I need to add hyphens so that they look like: 978-1-107-00000-0

       

      I reckon GREP is the way but I'm pretty hopeless at that. Any ideas?

       

      Many thanks!

        • 1. Re: Add hyphens to ISBN number
          vladan saveljic Level 4

          try this grep:

           

          find

          \b(\d{3})(\d)(\d{3})(\d{5})(\d)\b

           

          change

          $1-$2-$3-$4-$5

          • 2. Re: Add hyphens to ISBN number
            fraiquin Level 1

            Many thanks - that was perfect!

             

            Much appreciated.

            • 3. Re: Add hyphens to ISBN number
              Test Screen Name Most Valuable Participant

              This may be worth mentioning. The grep will be fine if you are working only with books from one publisher, CUP, with code 1-107. If you are doing this in general you may not know that the sections in an ISBN are of different lengths. Even those from the same publisher...

               

              Other ISBN ranges for Cambridge University Press: Cambridge University Press (978-0-511-...) · Cambridge University Press (978-0-521-...) · Cambridge University Press (978-0-931837-...) · Cambridge University Press (978-0-949009-...) · Cambridge University Press (978-1-108-...) · Cambridge University Press (978-1-139-...) · Cambridge University Press (978-1-316-...) · Cambridge University Press (978-1-4213-...) · Cambridge University Press (978-1-55899-...) · Cambridge University Press (978-4-902290-...) · Cambridge University Press (978-84-8323-...) · Cambridge University Press (978-84-9036-...) · Cambridge University Press (978-93-82993-...)