• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Add hyphens to ISBN number

New Here ,
Aug 11, 2017 Aug 11, 2017

Copy link to clipboard

Copied

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!

Views

909

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Guide , Aug 11, 2017 Aug 11, 2017

try this grep:

find

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

change

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

Votes

Translate

Translate
Guide ,
Aug 11, 2017 Aug 11, 2017

Copy link to clipboard

Copied

try this grep:

find

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

change

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 11, 2017 Aug 11, 2017

Copy link to clipboard

Copied

Many thanks - that was perfect!

Much appreciated.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 18, 2022 Sep 18, 2022

Copy link to clipboard

Copied

It's working as a single query but not in the script.

When creating a script for this it shows an error for \b and all \ are not showing in the find option.

ShankarKalbhor_0-1663487902579.png

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 03, 2022 Oct 03, 2022

Copy link to clipboard

Copied

LATEST

@vladan saveljic I found a solution for this we need to add extra backlash if we want to use it in the script.

 

\\b(\\d{3})(\\d)(\\d{5})(\\d{3})(\\d)\\b
 
Many thanks!!
Share the knowledge...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 11, 2017 Aug 11, 2017

Copy link to clipboard

Copied

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-...)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines