Extraire une partie du nom d'un fichier

J’ai une idée qui pourrait être intéressante pour LO Writer.
Nous pouvons inclure via des menus un “Nom de fichier sans extension” dans un fichier. (Insertion/champ/autre/etc.)
Il serait intéressant que l’on puisse inclure une partie du nom, une partie de la chaîne de caractères. Il doit certainement déjà exister une fonction qui fait ce travail.
Une fonction du genre : extractchaine(chaine, place, caractère)

  • Place étant la place du mot ou de la lettre recherchée dans la chaîne.
  • Caractère étant le caractère séparateur (" " ou “-”, ou…).

Quand pensez-vous ?

Connaissez-vous aussi le URL Français - Ask LibreOffice?

Without extension. No one knows if document (txt) or spreadsheet or slide. So file type is always part of a file name.

The French “fichier” means a folder. The less I undertstand the intentions.
The LibreOffice API includes an interface XURLTransformer offering some related functions like parseStrict and assemble. Neither for folders notr for filenames it handles the extensions separately.
(LibreOffice widely ignores the extension of a filename if you open a file with it. The component to be created is chosen based on the mime-type.)

Was there a specific reason to reactivate this old thread?
The original questioner wasn’t seen for nearly 4 years now in the forum.

@Lupp: French “fichier” is a “file”; a “folder” is a “dossier”. I, too, don’t understand the intention.

Thanks! My French is even worse than I thaught. It’s too bad about the many hours I tried to learn French 60 years ago,

Don’t beat yourself. I can read general ideas in German (like it happened in a recent thread), but my writing is painfully slow!

I’m not convinced that such a proposal would make sense. The file name is “external” to the document. By “external”, I mean that it can be changed independently from the contents. Imagine a scenario where you transmit the document to a third party. There, the name is changed to fit into the naming convention for archival. What happens to your extraction/field inclusion? If you extract based on separators and separators are no longer present, is the result still relevant?

Unless you give more details on your intended purpose, I think it is more reliable (no unintentional modification by recipient) and safer (more consistent result) to use a custom property in File>Properties. I use them extensively to record document version, language and many others. I insert them in several locations, notably in “complex” headers to build an equivalent of a title block in engineering drawing.

Final remarks:

  • feature requests should be filed on the bugzilla site
  • vous êtes sur la partie anglaise du site où le français n’est pas la langue officielle

The thread is very old:

Yes, I realised it only after having answered due to eionmac’s reactivation.

Cette proposition n’est intéressante que si le fichier reste en interne ou qu’il est transmis sous forme de PDF ou autre.

This is an opinion, not an answer. It fits more as a comment under the initial question or as an update to the question.

Anyway, could you elaborate a bit more on a use case you might have in mind?