Paarweise Neunummerierung
Hallo zusammen,
ich möchte paarweise neu nummerieren.
Position 5 weist z.T. Paare auf, die in Position 4 neu gezählt werden sollen.
alt 0662_0007_000084_000000_000003_000001 neu 0662_0007_000084_000001_000003_000001
alt 0662_0007_000084_000000_000003_000002 neu 0662_0007_000084_000001_000003_000002
alt 0662_0007_000084_000000_000004_000001 neu 0662_0007_000084_000002_000004_000001
alt 0662_0007_000084_000000_000005_000001 neu 0662_0007_000084_000003_000005_000001
alt 0662_0007_000084_000000_000006_000001 neu 0662_0007_000084_000004_000006_000001
alt 0662_0007_000084_000000_000006_000002 neu 0662_0007_000084_000004_000006_000002
Könnt ihr helfen?
Danke und VG
ich möchte paarweise neu nummerieren.
Position 5 weist z.T. Paare auf, die in Position 4 neu gezählt werden sollen.
alt 0662_0007_000084_000000_000003_000001 neu 0662_0007_000084_000001_000003_000001
alt 0662_0007_000084_000000_000003_000002 neu 0662_0007_000084_000001_000003_000002
alt 0662_0007_000084_000000_000004_000001 neu 0662_0007_000084_000002_000004_000001
alt 0662_0007_000084_000000_000005_000001 neu 0662_0007_000084_000003_000005_000001
alt 0662_0007_000084_000000_000006_000001 neu 0662_0007_000084_000004_000006_000001
alt 0662_0007_000084_000000_000006_000002 neu 0662_0007_000084_000004_000006_000002
Könnt ihr helfen?
Danke und VG
Das macht kein sinn!
Reply to #1:
Let me rephrase this to understand:
- First you sort alphabeticcaly which happen to be from small to large.
- When the fifth number is the same you create a "group number" at the fourth number.
- Every item within a group is numbered at the sixth number.
Could this be done with scripts?
Edit: the sixth number doesnt change, so the groupnumber 'just' has to be put at the fourth number.
Let me rephrase this to understand:
- First you sort alphabeticcaly which happen to be from small to large.
- When the fifth number is the same you create a "group number" at the fourth number.
- Every item within a group is numbered at the sixth number.
Could this be done with scripts?
Edit: the sixth number doesnt change, so the groupnumber 'just' has to be put at the fourth number.
Antwort auf #3:
Ja, die nummerische Sortierung in Position 4 (Gruppennummer) ergibt sich aus den vorhandenen Paaren in Position 5, die nach der Umnummerierung obsolet wird.
alt 0662_0007_000084_000000_000003_000001 neu 0662_0007_000084_000001_000001
alt 0662_0007_000084_000000_000003_000002 neu 0662_0007_000084_000001_000002
alt 0662_0007_000084_000000_000004_000001 neu 0662_0007_000084_000002_000001
alt 0662_0007_000084_000000_000005_000001 neu 0662_0007_000084_000003_000001
alt 0662_0007_000084_000000_000006_000001 neu 0662_0007_000084_000004_000001
alt 0662_0007_000084_000000_000006_000002 neu 0662_0007_000084_000004_000002
Danke für die Unterstützung!
Ja, die nummerische Sortierung in Position 4 (Gruppennummer) ergibt sich aus den vorhandenen Paaren in Position 5, die nach der Umnummerierung obsolet wird.
alt 0662_0007_000084_000000_000003_000001 neu 0662_0007_000084_000001_000001
alt 0662_0007_000084_000000_000003_000002 neu 0662_0007_000084_000001_000002
alt 0662_0007_000084_000000_000004_000001 neu 0662_0007_000084_000002_000001
alt 0662_0007_000084_000000_000005_000001 neu 0662_0007_000084_000003_000001
alt 0662_0007_000084_000000_000006_000001 neu 0662_0007_000084_000004_000001
alt 0662_0007_000084_000000_000006_000002 neu 0662_0007_000084_000004_000002
Danke für die Unterstützung!
Reply to #4:
"Yes, the numerical sorting in position 4 (group number) results from the existing pairs in position 5, which will become obsolete after the renumbering. "
Use a Script method.
It is easier to base the new numbers on the numbers in position 6.
Define a variable group= 0 in the pre batch script.
Then, in the main script increment this variable by one whenever the number in position 6 is equal to 1
Verwenden Sie eine Skriptmethode.
Es ist einfacher, die neuen Zahlen auf den Zahlen an Position 6 zu basieren.
Definieren Sie im dem Skript vor dem Batch-Job eine Variable group = 0.
Erhöhen Sie dann im Hauptskript diese Variable um eins, wenn die Zahl an Position 6 gleich 1 ist.
Pre-batch script (Skript vor dem Batch-Job):
group = 0;
Main Script:
name = item.name.match(/((.*?_){3}).*?_.*?_(.*)/);
if (1*name[3]==1) group++;
return name[1] + ("000000" + group).slice(-6) + "_" + name[3];
"Yes, the numerical sorting in position 4 (group number) results from the existing pairs in position 5, which will become obsolete after the renumbering. "
Use a Script method.
It is easier to base the new numbers on the numbers in position 6.
Define a variable group= 0 in the pre batch script.
Then, in the main script increment this variable by one whenever the number in position 6 is equal to 1
Verwenden Sie eine Skriptmethode.
Es ist einfacher, die neuen Zahlen auf den Zahlen an Position 6 zu basieren.
Definieren Sie im dem Skript vor dem Batch-Job eine Variable group = 0.
Erhöhen Sie dann im Hauptskript diese Variable um eins, wenn die Zahl an Position 6 gleich 1 ist.
Pre-batch script (Skript vor dem Batch-Job):
group = 0;
Main Script:
name = item.name.match(/((.*?_){3}).*?_.*?_(.*)/);
if (1*name[3]==1) group++;
return name[1] + ("000000" + group).slice(-6) + "_" + name[3];
Antwort auf #5:
Besten Dank für Ihre Hilfe!
Besten Dank für Ihre Hilfe!