Announcement

Collapse
No announcement yet.

Include original file extension in new file name

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Solved Include original file extension in new file name

    Hi there. I am trying to do a batch convert and resize on multiple folders.

    I am using the following rename mask
    $N-small-$O-######

    The problem is that that gives me: IMG_1008-small-.CR2000035.jpg with a period/fullstop before old file format. I am worried this might cause problems for some programs. Is there a way to have the file extension without the fullstop?

    So to repeat I am looking for
    IMG_1008-small-.CR2-000035.jpg
    to be
    IMG_1008-small-CR2-000035.jpg

    Many thanks!

    #2
    I think you need to use $N = Old filename without extension.
    Before you post Edit your profile • IrfanView 4.72 • Windows 10 Home 19045.2486

    Irfan PaintIrfan View HelpIrfanPaint HelpMore SkinsFastStone CaptureUploads

    Comment


      #3
      I assume that the original filename is IMG_1008.CR2 and you want to save it as a .JPG file. Is that correct?
      If so are all your originals .CR2 files?

      If the original filename is "IMG_1008.CR2" then the placeholder $F would return the whole file name, "IMG_1008.CR2"
      $N will return the part before the full stop, "IMG_1008" and $O will return what remains, ".CR2"
      ###### then returns the image count, in your example "000035", and saving as a JPG file adds ".jpg" on the end.

      So that is why you get the full stop in ".CR2". However if it is the only full stop in the file name it can easily be removed. Open "Options" to the left of the "Name pattern" box and type a full stop in the box "Replace text(1)" and leave the "with" box empty. It will not remove the full stop in ".jpg" because that is added later when the new file is saved.
      Last edited by Mij; 01.10.2016, 03:54 PM. Reason: Added the full answer, hoping to save another reply.

      Comment


        #4
        Originally posted by Mij View Post
        if it is the only full stop in the file name it can easily be removed. Open "Options" to the left of the "Name pattern" box and type a full stop in the box "Replace text(1)" and leave the "with" box empty. It will not remove the full stop in ".jpg" because that is added later when the new file is saved.
        Perfect - that is exactly what I was after. Many thanks for taking the time to respond (and Bhikkhu Pesala as well). It has now exposed another problem but I will raise a new thread for that.
        Many thanks again!

        Comment


          #5
          Just a warning, vilbs. It is very difficult to spot that single full stop in the Replace text box so remember to delete it when you have finished using it. Otherwise you will keep removing full stops from the file name for evermore.

          Comment

          Working...
          X