lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bookOutputName still gets "-1" suffix added to SVG file names


From: Jeff Olson
Subject: Re: bookOutputName still gets "-1" suffix added to SVG file names
Date: Thu, 30 Mar 2023 19:03:06 -0600
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.9.1

On 3/30/2023 10:11 AM, David Wright wrote:
    32 -rwxrwxrwx+ 1 J None   32199 Mar 29 22:25  Foo-1.svg*
    32 -rwxrwxrwx+ 1 J None   32190 Mar 29 22:25  Abc-1.svg*
    32 -rwxrwxrwx+ 1 J None   32231 Mar 29 22:25  Bar-1.svg*
That looks like a linux platform.
But it's Windows 10 running the cygwin.dll
(see http://cygwin.com/ and https://en.wikipedia.org/wiki/Cygwin)


If the thousand-odd files are in a single directory, and you like
visual interfaces, renaming them is very simple in a TUI-style
file manager like Midnight Commander (mc). You'd rename (called
Move) from *-1.svg to *.svg after selecting all the files with
the * keystroke.

If you prefer a CLI, then it's as simple as:

   $ cd directory-containing-files
   $ rename 's/-1\.svg$/.svg/' *.svg

except for the complication of which version of rename you have
installed on your system. I prefer the version that uses a Perl
expression, and it's set up as the default on my system for the
"rename" command, but can also be invoked as prename or file-rename.

Where files are scattered amongst directories, the CLI rename command
can be invoked from a find command, which searches directory trees for
suitable filenames to rename.

Cheers,
David.

Thanks for your detailed assistance, David!

The rename command in my cygwin doesn't look like it takes Perl REs,
which I'd prefer instead:

$ rename -V
rename from util-linux 2.33.1

SYNOPSIS
       rename [options] expression replacement file...

DESCRIPTION
       rename will rename the specified files by replacing the first occurrence
       of expression in their name by replacement.

But as this is part of my process going forward, I'll probably use
bash pattern matching or write a Perl script.

If it's just removing the "-1" it's easy, as you indicate.
But the MidiMismatch example that I showed Jean would be more difficult.

Still holding out hope that ly developers may take the suggestion
I made to Jean, which would allow everything to be resolved inside ly.

Thx again,
Jeff




reply via email to

[Prev in Thread] Current Thread [Next in Thread]