https://github.com/gfngfn/renumber-image-files
Just for personal use
https://github.com/gfngfn/renumber-image-files
Last synced: 7 months ago
JSON representation
Just for personal use
- Host: GitHub
- URL: https://github.com/gfngfn/renumber-image-files
- Owner: gfngfn
- License: bsd-3-clause
- Created: 2019-08-11T06:27:15.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-06-26T19:26:38.000Z (over 2 years ago)
- Last Synced: 2025-01-16T00:00:05.918Z (9 months ago)
- Language: Haskell
- Homepage:
- Size: 38.1 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: ChangeLog.md
- License: LICENSE
Awesome Lists containing this project
README
# `renum-files-exe`
This is a small tool for renumbering images developed for @gfngfn's personal use.
## How to Compile
```
$ stack build
```## How to Install
The following command will install binary executable `renum-files-exe`:
```
$ stack install
```## How to Use
### Checking
The following command checks whether the given directory contains files with inconsistent indices (e.g. containts both `foo004.jpg` and `foo004_01.jpg`):
```console
$ renum-files-exe --check source/
```Filenames must match `\a+\d\d\d(\_\d\d)?\.\a+`.
### Normalization
The following command normalizes indices (i.e. eliminates all the gaps between indices):
```console
$ renum-files-exe --normalize target/
```### Unification
```console
# the source directory, the contents of which have been added manually
$ ls source/
bar003.png
bar008_01.jpeg
bar008_02.jpeg
foo001.jpeg
foo004_01.png
foo004_02.png
foo042.jpg# the target directory, where files are to be kept with normalized indices
$ ls target/
bar001.jpg
bar002_01.png
bar002_02.png
bar002_03.png
bar003.png
bar004.jpg
foo001_01.jpg
foo001_02.png
foo002.jpg$ renum-files-exe --normalize source/ target/
# (some texts on stdout)$ ls source/
$ ls target/
bar001.jpg
bar002_01.png
bar002_02.png
bar002_03.png
bar003.png
bar004.jpg
bar005.png # <= source/bar003.png
bar006_01.jpg # <= source/bar008_01.jpeg
bar006_02.jpg # <= source/bar008_02.jpeg
foo001_01.jpg
foo001_02.png
foo002.jpg
foo003.jpg # <= source/foo001.jpeg
foo004_01.png # <= source/foo004_01.png
foo004_02.png # <= source/foo004_02.png
foo005.jpg # <= source/foo042.jpg
```### Summing up
The following command counts how many indices are used for each tag:
```console
$ renum-files-exe --sum-up target/
```