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!
try this grep:
find
\b(\d{3})(\d)(\d{3})(\d{5})(\d)\b
change
$1-$2-$3-$4-$5
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
Copy link to clipboard
Copied
Many thanks - that was perfect!
Much appreciated.
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.
Copy link to clipboard
Copied
@vladan saveljic I found a solution for this we need to add extra backlash if we want to use it in the script.
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-...)