View Single Post
Old 08-14-2012, 09:24 AM   #4
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 31,109
Karma: 60406498
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by Rob557 View Post
Thanks theducks. I may be missing something in how to use that regular expression approach:

In the bulk edit search and replace I did the following:
search field: title
search for: (.+)\s+\[.+\d+\]\s-\s(.+)
replace with: \1 - \2
destination field: test#
your test field: Title [3] - Author
but the "test result" field came out as "Title [3] - Author" ... i.e. it did not show any changes.

To expand on my earlier comments, the following illustrates the most common examples that I am coming across for the contents of the title field:
series # - title (i.e. no brackets around the number)
series - # - title
series - title
but I'm not having much luck so far trying to modify that regular expression approach.
See, your pattern was Not the most common i have seen.
One size REGEG does not fit any except the EXACT one it was crafted for
You have 3 cases: (although 1 and 2 could be accomplished together with a more complex REGEX)

series # - title
.+ \d+\s-\s

series - # - title
.+\s-\s\d+\s-\s
(this may work for both this and the above:
.+\s(|-\s)\d+\s-\s
)

series - title
.+\s-\s
theducks is offline   Reply With Quote