Group Abstract Group Abstract

Message Boards Message Boards

0
|
58 Views
|
2 Replies
|
2 Total Likes
View groups...
Share
Share this post:

How to batch insert all image files in a specified folder?

Posted 1 day ago

enter image description here

Usually, we insert a small number of images in a notebook using the method shown in the figure. If there are many images to insert, what method can be used to insert all image files in a certain folder at once?

POSTED BY: Bill Blair
2 Replies

Assuming they're all of the same file extension, you can use the * character to get all the files of a given extension in a directory. For example if they were PNG images

Import[FILEPATH, "*.png"]

Be careful to note that this will extract all PNG images at any level, even within subdirectories of FILEPATH. If you only want files explicitly in FILEPATH you can append *.png to the FILEPATH:

Import[FileNameJoin[{FILEPATH, "*.png"}]]
POSTED BY: David Trimas
POSTED BY: Michael Rogers
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard