Welcome, Guest
Try to get help from other ComicRack users

TOPIC: Double extension files

Double extension files 1 year 3 weeks ago #46425

  • ChrisR
  • ChrisR's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 17
  • Thank you received: 6
  • Karma: 0
Hello,

I just found a "nice" collection of files in my HD that have a double extension, filename.cbz.cbz and they are entered to the Comicrack mysql database accordingly so there is no problem accessing the files from the program.

Is there a way to rename the files and reflect these changes to the database?

Any indication on how to achieve this will be greatly appreciated!
Thanks for reading.
The administrator has disabled public write access.

Double extension files 1 year 3 weeks ago #46452

  • Xelloss
  • Xelloss's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 455
  • Thank you received: 117
  • Karma: 24
Try any file renaming script... for example Library Organizer... This wil move and rename the files according to rules changing the database entry to the new name and folder...

The problem you will have with this is that for any program, there are not "double extensions" there are only extensions (anything after the LAST ".") and name (anything before the LAST "."). So, for Windows and Comicrack the "first extension" will be part of the name... You can make a rule that delete anything between the LAST TWO ".", but this will also delete things as for example: the ".D" in S.H.I.L.D.CBZ. You would have to be very carefull with the rules you use to only delete the "second" extension...

Another way would be to filter all the comics with double extension and just delete (again with a file rename script that sync the database) the "last" extension...
The administrator has disabled public write access.

Double extension files 1 year 3 weeks ago #46454

  • jkthemac
  • jkthemac's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 766
  • Thank you received: 253
  • Karma: 55
Well this should be possible very easily with Data Manager if you could rewrite the filename. Unless I am mistaken you cant (not sure why).

The rest of the rule set would be super easy.

You would use a regex expression like:
\.(...)\.\1$
To locate double extension ending in FilePath and then replace on FileName
(.*)\....$
with
$1
Last Edit: 1 year 3 weeks ago by jkthemac.
The administrator has disabled public write access.

Double extension files 1 year 3 weeks ago #46457

  • ChrisR
  • ChrisR's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 17
  • Thank you received: 6
  • Karma: 0
I played a bit with DM and RegExVarReplace and it ended creating a pair of new custom fields: FileName and FilePath where it successfully removed the .cbz, but I'm unable to get the same for the real Comicrack File Name and File Path.

Also tried jkthemac solution but i can not get any results from DM, the log window is empty after the process has ended, I'm probably applying them wrong.

I can rename the affected files in the HD with an external program.

Thanks for your answers,
The administrator has disabled public write access.

Double extension files 1 year 3 weeks ago #46458

  • Xelloss
  • Xelloss's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 455
  • Thank you received: 117
  • Karma: 24
jkthemac wrote:
Well this should be possible very easily with Data Manager if you could rewrite the filename. Unless I am mistaken you cant (not sure why).

The rest of the rule set would be super easy.

You would use a regex expression like:
\.(...)\.\1$
To locate double extension ending in FilePath and then replace on FileName
(.*)\....$
with
$1

wouldn't that delete things such as "001" in Spider-Man.001.cbr?

I would make a rule that only delete cbr, cbz y cbt.... many people use "." instead of spaces in filenames...
The administrator has disabled public write access.

Double extension files 1 year 3 weeks ago #46461

  • ChrisR
  • ChrisR's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 17
  • Thank you received: 6
  • Karma: 0
Just used the in-build Search and Replace with File Path and worked nicely!

Tomorrow that a I have a bit more time I'll process the rest of the files.

Thanks
The administrator has disabled public write access.

Double extension files 1 year 3 weeks ago #46463

  • jkthemac
  • jkthemac's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 766
  • Thank you received: 253
  • Karma: 55
Xelloss wrote:
wouldn't that delete things such as "001" in Spider-Man.001.cbr?

I would make a rule that only delete cbr, cbz y cbt.... many people use "." instead of spaces in filenames...

no, because in
\.(...)\.\1$
which would be applied to the path and used as a filter, the \1 will only match what is already matched in the parenthesis. Because the path includes the extension and the filename does not, it is easier to filter on path to find the double extensions which will be a repeat pattern.

This first match would be used for finding the correct files and would filter out anything unless it had a repeated .123.123 type pattern at the end. So the actual replace is generic, but it would never be applied to 'name.001.cbz', only 'name.001.001' or 'name.cbz.cbz'

However, as Data Manager doesn't seem to change file names it is academic.

HOWEVER @ChrisR
ChrisR wrote:
Also tried jkthemac solution but i can not get any results from DM, the log window is empty after the process has ended, I'm probably applying them wrong.
Sorry to confuse you. My solution wasn't actually possible it was hypothetical. Which is no use to you but there is a solution. You can use this filter in a Smart List and find every culprit.


File Attachment:

File Name: Doubleextension.cbl
File Size:0 KB


and if you only have a few you can edit them in ComicRack:


Last Edit: 1 year 3 weeks ago by jkthemac.
The administrator has disabled public write access.

Double extension files 1 year 3 weeks ago #46465

  • ChrisR
  • ChrisR's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 17
  • Thank you received: 6
  • Karma: 0
jkthemac wrote:
Sorry to confuse you. My solution wasn't actually possible it was hypothetical. Which is no use to you but there is a solution. You can use this filter in a Smart List and find every culprit.

File Attachment:

File Name: Doubleextension.cbl
File Size:0 KB

and if you only have a few you can edit them in ComicRack:

No problem I'm grateful for the explanations you both were providing :)

At last the solution was quick and easy, using your Smart List to identify the files, about 12.000 of them were found, then applying the built in script Search and Replace for File Path.
With an external program, in my case Directory Opus, I searched, renamed and finally refreshed in Comicrack to link them again.

Job done.
Thank you both again!
The administrator has disabled public write access.

Double extension files 1 year 3 weeks ago #46466

  • jkthemac
  • jkthemac's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 766
  • Thank you received: 253
  • Karma: 55
Yes that was quite a few. No Wonder you resorted to S&R. Glad the smart list helped.
Last Edit: 1 year 3 weeks ago by jkthemac.
The administrator has disabled public write access.
Time to create page: 0.197 seconds

Who's Online

We have 231 guests and 5 members online