URL / CRM / Accounting

How to get a file extension from a URL or path

2026-06-21
Task

A URL or path needs to produce file_ext: xlsx, pdf, jpg, normalized to lowercase.

Short answer

Clean parameters, keep the last dot extension, remove the dot, and convert the result to lowercase.

How to do it in Eofferix

  1. Upload the table with file URLs or paths.
    File extension extracted from URL in Eofferix
    The file_ext column contains the normalized file extension.
  2. Create file_ext from file_url: remove ? and #, keep \.[A-Za-z0-9]+$, remove the dot, and lowercase the result.
    Rules for extracting file extension
    The rule chain cleans the URL, keeps the extension, removes the dot, and lowercases the result.
  3. Check files with uppercase extensions and parameters after the file name.
  4. Save the template.

Before / after

The data below is a training example and does not belong to real user files.

Before

source data
idfile_url
1001https://cdn.example.com/files/catalog/price-list.XLSX?download=1
1002/uploads/manuals/product-guide.PDF#open

After

result
idfile_ext
1001xlsx
1002pdf

Process data faster with Eofferix

Create a free account to automate catalogs and price lists around your own rules.

Sign up