As the title says, I have a problem regarding the swapping of firstname lastname. If it is just one set, I can do it with a regex. But having a list (FN LN; FN LN; FN LN;...), I don't get the propper result. I tried a few examples from the forum and ended with:
[#0]
T=5
F=COMPOSERSORT
1=%COMPOSER%
[#1]
T=2
F=COMPOSERSORT
1=;
2=;
3=0|0
[#2]
T=4
F=COMPOSERSORT
1=([^;]+)\\\\s([^;]+)
2= $2, $1
3=0which leaves me with the right result, only I still have to cut away a leading extra space.
But my problem is, that I need it all in one action, not three. What I wood like to have is something like that:
T=5
F=COMPOSERSORT
1=$if2(%composersort%,$regexp($regexp(%composer%,(.*?) (\\\\w*)(', '|$),$2', '$1; ),; $,))But working with a list, and not just one name. As I only want to change the field, if it not filled, I can't use the long example, as it would make changes regardless if it is empty or not.
Has anyone of you a good idea?