#1 : 19/05-16 14:10 Rien
Posts: 6
|
In my data records now:
booktitle - fistname familyname I want to have it as follows: booktitle - familyname, firstname Do you have the solution for this? Thanks in advance |
#2 : 19/05-16 23:13 Tester123
Posts: 92
|
Reply to #1:
This Replace Method should do the trick: Text to be replaced: (.+)( - )(.+) (.+) Replace with: \1\2\4, \3 Use regular expression: Tick Summary: Define 4 groups, denoted by the parentheses '()'. Group 1 (booktitle): at least one of any character, but stop when reached group 2... Group 2 (separator): a space followed by a dash and then a space Group 3 (firstname): at least one of any character, but stop when found a space Group 4 (familyname): at least one of any character In the replace, we rearrange the filename using the defined groups above, referring to them using the '\#' notation where # is the group number, to give the desired order, e.g. '\1\2\4, \3'. |
#3 : 20/05-16 14:03 Rien
Posts: 6
|
Reply to #2:
Thanks for your quick answer! Most probably I do something wrong because it did not work out as I hoped: Original data was: Basuco - Herman Vemde.epub This is what I get: Herman Vende - Basuko.epub But I want: Basuco - Vende, Herman.epub I used the following parameters: -Replace Text to be replaced: (.+)( - )(.+) (.+) Replaced with: \1\2\4, \3 Occurence: All Use regular expressions: v Apply to: Name What did I do wrong? |
#4 : 20/05-16 21:22 Tester123
Posts: 92
|
Reply to #3:
I'm not sure why it doesn't work for you, your examples work for me. Are you using version 3.72, that's the version I tried this on? |
#5 : 21/05-16 12:16 Rien
Posts: 6
|
Reply to #4:
I'm using 3.72.0.0 March 27, 2016 I really hope you can help me because I have to convert about 500 items! |
#6 : 21/05-16 15:47 Tester123
Posts: 92
|
Reply to #5:
I don't think this little tweak will work for you either, but no harm in trying. Again, using the "Replace" Method: Text to be replaced: (.+\s-\s)(.+)\s(.+) Replace with: \1\3, \2 Occurrence: All Case sensitive: Untick Use regular expressions: Tick Apply to: Name If this doesn't work (which I don't expect it to as the original didn't) then I'm stumped, and hope someone else can help. And do you have any other methods active, or only this one? |
#7 : 21/05-16 20:40 joci
Posts: 11
|
Reply to #6:
Both solutions work fine here. Greetings Jon |