Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Remove .JPG Extension from File Name

Featured Replies

I am having difficulty removing the .JPG extension from the file name of my imported pictures. The Pictures are actually students pictures saved with the student's ID Numbers.

Example SLT-098-00034.jpg  ,  SLT-088-11123.jpg

I am trying to extract the real ID Numbers from the File names which should be in this format  SLT/098/33322

Accomplishment So Far..

Using the Substitute function,  Substitute (text; searchstring; replacestring)  , I have been able to convert the file name from SLT-098-00034.jpg  to SLT/098/00034.jpg

Now, I want to remove the .jpg extension, but can't achieve that using the Substitute function..  Please is there a better way to achieve this?

26 minutes ago, shevyshevy said:

Now, I want to remove the .jpg extension, but can't achieve that using the Substitute function.

Sure you can. You can substitute ".jpg" with nothing.

You could also use the Left() function to remove the last 4 characters.

 

Edited by comment

  • Author

Thanks for your reply.. Here is what I did.. I created two fields, ID1 and ID2,   On ID1, i used the Substitute function Substitute (File_Name; "-"; "/") that gave me the first result with the ".jpg" still attached

I now used the substitute function on ID2 as follows Substitute (ID1; ".JPG"; "") .. I was hoping that its gonna remove the final ".jpg" extension so that the ID Number comes out clean.. But it didnt..

As for the Left() function, guess I am really familiar with it. Please how can use it to achieve this?

22 minutes ago, shevyshevy said:

I now used the substitute function on ID2 as follows Substitute (ID1; ".JPG"; "") .. I was hoping that its gonna remove the final ".jpg" extension

Substitute() is one of the few functions that's case-sensitive, so Substitute ( "filename.jpg" ; ".JPG" ; "" ) will not do anything.

 

22 minutes ago, shevyshevy said:

I created two fields, ID1 and ID2,  

That's not necessary. You can nest multiple substitutes within a single Substitute() function call:

Substitute ( Filename ; [ "-" ; "/" ] ; [ ".jpg" ; "" ] ) 

will return "SLT/098/00034" when Filename contains "SLT-098-00034.jpg".

 

22 minutes ago, shevyshevy said:

As for the Left() function, guess I am really familiar with it. Please how can use it to achieve this?

If all your file names have the same length, then:

Left ( Substitute ( Filename ;  "-" ; "/" ) ; 13 )

would do the same thing. If they're not, then you could use:

Left ( Substitute ( Filename ;  "-" ; "/" ) ; Length ( Filename ) - 4 )

to remove the last 4 characters, no matter what the length is.

 

Edited by comment

  • Author

Thanks a million..

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.