• Changing from capital to small letters in filenames

    From Aelius Gallus@21:1/5 to All on Sat Nov 3 06:03:59 2018
    I have about 90 photo files in a directory.
    How do I change them from the capital letters format to the small one,
    that is, from "CIMGxxxx.JPG" to the "cimgxxxx.jpg" format.
    I am not a programer, and sorry for a very basic question for the experience people of this newsgroup.
    Any suggestion will be appreciated.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mark Carroll@21:1/5 to Aelius Gallus on Sat Nov 3 10:16:03 2018
    On 03 Nov 2018, Aelius Gallus wrote:

    How do I change them from the capital letters format to the small one,
    that is, from "CIMGxxxx.JPG" to the "cimgxxxx.jpg" format.

    First, make a copy of the directory, in case whatever you try messes
    things up somehow. Even if you think that you changed the names
    correctly, take a look at a couple of photographs afterward to be sure.

    I'd probably cd into the directory with the photographs then do
    something like,

    for i in * ; do mv "$i" /tmp/photo ; mv /tmp/photo "`echo "$i" | tr '[A-Z]' '[a-z]'`" ; done

    I hope that helps.

    -- Mark

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Aelius Gallus@21:1/5 to Mark Carroll on Sat Nov 3 12:48:32 2018
    Mark Carroll <mtbc@bcs.org> wrote:
    On 03 Nov 2018, Aelius Gallus wrote:

    How do I change them from the capital letters format to the small one,
    that is, from "CIMGxxxx.JPG" to the "cimgxxxx.jpg" format.

    First, make a copy of the directory, in case whatever you try messes
    things up somehow. Even if you think that you changed the names
    correctly, take a look at a couple of photographs afterward to be sure.

    I'd probably cd into the directory with the photographs then do
    something like,

    for i in * ; do mv "$i" /tmp/photo ; mv /tmp/photo "`echo "$i" | tr
    '[A-Z]' '[a-z]'`" ; done

    I hope that helps.

    -- Mark
    Your incantation worked like a charm!. I don't know how you figured it out because it is very long and complicated for me to remember. I copied it
    into a file, so I will just copy and paste it next time I need it.
    Thank you Mark.
    Aelius

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mark Carroll@21:1/5 to Aelius Gallus on Sat Nov 3 13:56:17 2018
    On 03 Nov 2018, Aelius Gallus wrote:

    Your incantation worked like a charm!. I don't know how you figured it out because it is very long and complicated for me to remember. I copied it
    into a file, so I will just copy and paste it next time I need it.

    Great, thank you for letting us know it that worked for you. You can
    find out about the kind of approach I used from "Unix tools" types of
    courses from maybe thirty years ago. Then people started using Perl for
    this kind of thing, now probably Python, but, broadly: if it's simple to describe then the older standard command-line BSD tools can probably be
    put together somehow to make it happen.

    -- Mark

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Aelius Gallus@21:1/5 to Mark Carroll on Sun Nov 4 01:22:40 2018
    Mark Carroll <mtbc@bcs.org> wrote:
    Great, thank you for letting us know it that worked for you. You can
    find out about the kind of approach I used from "Unix tools" types of
    courses from maybe thirty years ago. Then people started using Perl for
    this kind of thing, now probably Python, but, broadly: if it's simple to describe then the older standard command-line BSD tools can probably be
    put together somehow to make it happen.

    -- Mark
    Thank you for letting us know your sources and adding a short history of
    Unix related tools. By the way, things have simplified by making the file, where the suggested commands had been copied, executable and placed in my $PATH.
    Best regards,
    Aelius

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)