Anforderung (Linux, FreeBSD, Darwin -> Bashscript):
----
Innerhalb eines Ordners liegen Dateien mit einer Zählung im Dateinamen.
Für den Fall, dass Dateien hinzugefügt oder entfernt werden, soll die Zählung angepasst werden.
Struktur:
-- Ordnername
------ [login to view URL]
------ [login to view URL]
------ [login to view URL]
------ [login to view URL]
------ [login to view URL]
------ [login to view URL]
------ [login to view URL]
------ [login to view URL]
------ [login to view URL]
------ [login to view URL]
------ [login to view URL]
------ [login to view URL]
------ [login to view URL]
- Ordnername und Praefix sind identisch
- Mögliche Dateiendungen sind tif, jpg, jp2
- Die Gesamtzahl der Dateien im Ordner ist unbekannt
Fall 1 - Zählung erweitern:
----
Fallbeispiel: Es ist notwendig zwischen [login to view URL] und [login to view URL] 18 Dateien einzufügen.
Das bedeutet, dass auf alle Dateien ab der Datei [login to view URL] die Zahl 18 zu addieren ist.
Fall 2 - Zählung verringern:
----
Fallbeispiel: Es ist notwendig die Dateien [login to view URL] und [login to view URL] zu löschen.
Das bedeutet, dass von der Zählung im Dateinnamen ab der Datei [login to view URL] die Zahl 2 abzuziehen ist.
Wurden die Dateien [login to view URL] und Praefix_00000007 zur Skriptlaufzeit noch nicht aus dem Ordner gelöscht, sollen sie nicht durch das Skript überschrieben oder gelöscht werden. In diesem Fall soll eine Meldung ausgegeben werden.
Fall 3 - Zum Beispiel [login to view URL] löschen oder erweitern
----
Das Skript ebenso ermöglichen eine konkrete Zahl zu löschen oder die Abfolge um eine konkrete Zahl zu erweitern.
----------------------
request (Linux, FreeBSD, Darwin -> Bashscript):
----
Within a folder, there are files with a count in the file name.
If files are added or removed, the count should be adjusted.
Structure:
-- Folder name
------ [login to view URL]
------ [login to view URL]
------ [login to view URL]
------ [login to view URL]
------ [login to view URL]
------ [login to view URL]
------ [login to view URL]
------ [login to view URL]
------ [login to view URL]
------ [login to view URL]
------ [login to view URL]
------ [login to view URL]
------ [login to view URL]
- Folder name and prefix are identical
- Possible file extensions are tif, jpg, jp2
- The total number of files in the folder is unknown
Case 1 - Extend count:
----
Case study: It is necessary to insert 18 files between [login to view URL] and Praefix_00000007.tif.
This means that the number 18 must be added to all files starting from the file Praefix_00000007.tif.
Case 2 - Decrease count:
----
Case study: It is necessary to delete the files [login to view URL] and Praefix_00000007.tif.
This means that the number 2 must be subtracted from the count in the file name starting with the file Praefix_00000008.tif.
If the files [login to view URL] and Praefix_00000007 have not yet been deleted from the folder at script runtime, they should not be overwritten or deleted by the script. In this case a message should be displayed.
Case 3 - For example delete or extend [login to view URL]
----
The script also allows to delete a concrete number or to extend the sequence by a concrete number.