Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: How to replace multiple dots in file name only ignoring file extension? #37

Open
r4dh4l opened this issue Oct 20, 2024 · 0 comments

Comments

@r4dh4l
Copy link

r4dh4l commented Oct 20, 2024

Hi,

I would like to replace/remove multiple . in a file name like test1.test2.test3.test4.flac.

I started with rnm -rs '/\.//g' ./* which replaces every . but the result is test1test2test3test4flac.
Then I tried rnm -rs '//n/./_/' ./* but this replaces the whole file name with an underscore so the result is _flac.

In this context I think the chapter https://neurobin.org/docs/unix/rnm/bulk-rename-in-linux/#12-applying-uppercase-lowercase-conversion-on-filenames-partially is a little bit misleading for me:

Now, lets change the case of filenames without the extensions, i.e .jpg, .png should be intact. To do that we will have to select the part before the last . and replace it ...

But rnm -rs '/.*\./_/' ./* replaces the whole file name except the extension. So maybe the quoted sentence should not say "the last ." but only "the .".

However: Is it possible to remove multiple dots in the file name without the extension dot?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant