Is it possible (and how) to create a file path if I know part of file pathname? For example I have file pathname /User/Documents/Italy/Report_123.pdf How to complete pathname if I know there is pdf in folder Italy which contain word Report_ those numbers at the end are dynamic?
I need to complete this task in javascript. Thanks in advance.
if you're using node.js, you can get all the files from that folder, then you iterate that result array to get the one you want.
import { readdir } from 'fs/promises';
const result = await readdir('C:/User/Documents/Italy');
console.log(result);
use this it may be helps you
var documentName = "Report_123.pdf"; // Use documentName Variable to use other js functions for example - documentName.split("_").
var path = "../User/Documents/Italy/"+documentName;