Can you tell me how to find a file in a folder with a specific extension? For example, png.
There may be several possible solutions. Suppose that the array with names is called
filtered_array = files_array.filter(x => x.includes(".jpg")) - filter the array so that all the elements that have the .jpg extension remain.
2. Cycle by
files_array. Use the “File Information” function and specify the full path. At the output we get the object with the values. One of the fields is extension. Further condition: if
current_file_info.extension === "jpg", you execute a branch. If not, you do not execute or execute another one. Since your file array contains only names, and we need full paths, you can add the rest of the path to all the elements at once. For example:
files_array.map(x => "C:\\tmp\\" + x)