From 1c43ac028d7d6122d5d4479bf9ea900e1e31b13c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beatrice=20Dellac=C3=A0?= Date: Wed, 1 Jun 2022 00:47:06 +0200 Subject: [PATCH] Move description to README.md --- README.md | 15 +++++++++++++++ src/main/java/org/example/Renamer.java | 13 +------------ 2 files changed, 16 insertions(+), 12 deletions(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..23ecc72 --- /dev/null +++ b/README.md @@ -0,0 +1,15 @@ +# Info +This simple and inefficient program was made to rename files in a folder that were numbered incorrectly. The files had the correct number in their name, but since most OSes use alphabetical order, it was not like this: +```text +1, 2, 3, 4, 5, 6, 7, 8, 9, 10... +``` +but like this: +```text +1, 10, 11, 12-19, 100, 101, 102... 2, 20, 21-29, 200, 201, 202... +``` +This is easily fixed by adding zeros before the actual number, up to the number of needed digits: +```text +001, 002, 003, 004... 010, 011... 020, 021... 100, 101... +``` + +The code only supports up to 3 digits but can easily be updated to handle more. \ No newline at end of file diff --git a/src/main/java/org/example/Renamer.java b/src/main/java/org/example/Renamer.java index 0ef8b5a..65e928e 100644 --- a/src/main/java/org/example/Renamer.java +++ b/src/main/java/org/example/Renamer.java @@ -7,19 +7,8 @@ import java.util.stream.Stream; public class Renamer { - - /* - this simple and inefficient program was made to rename files in a folder that were numbered incorrectly. - the files had the correct number in their name, but since most OSes use alphabetical order, it was not like this: - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10... - but like this: - 1, 10, 11, 12-19, 100, 101, 102... 2, 20, 21-29, 200, 201, 202... - this is easily fixed by adding zeros before the actual number, up to the number of needed digits: - 001, 002, 003, 004... 010, 011... 020, 021... 100, 101... - */ - - public static String path = "D:\\CD 2021\\foto"; + public static String path = "D:\\path\\to\\directory"; public static void main(String[]args) {