Importing Multiple Files from a Folder
FileMaker can import data from several files at once. In this batch mode, FileMaker takes the data from a file and imports it into one or more fields in a FileMaker table. FileMaker can also bring in information about each file's name and directory path.
FileMaker can work with two types of data when performing a folder import: image files and text files. In the case of image files, FileMaker can bring the image data from each file into a container field so that each image can be viewed inside FileMaker. In the case of text files, FileMaker brings the entire contents of the file into a specified text field.
Caution
FileMaker can store a maximum of 2GB of data in a single field. This may seem like a lot, and it is a lot compared to the limit of 64KB that was in force in previous versions of FileMaker! But it follows from this that you shouldn't import text or image files into FileMaker if any single imported file will be larger than 2GB.
Importing Text Files
Assume that you have a folder with a number of plain text files in it. Assume also that you have a FileMaker database that has a table in it with fields called TextContent, FileName, and FilePath. If you select File, Import Records, Folder, you'll see FileMaker's Folder of Files Import Options dialog box, shown in Figure 19.10.
Figure 19.10. FileMaker kicks off the Import From Folder process with a special initial dialog box.
In the upper area you can choose the folder from which to import data. You can also choose whether to confine the import to files at the first level inside the folder, or whether to drill into all the subfolders that might be below the top level.
After you've chosen a folder from which to import, choose the file type. To import from text files, choose the Text Files option and click Continue. You'll then see a folder import dialog box, similar but not identical to the regular Import Field Mapping dialog box, shown in Figure 19.11.
Figure 19.11. When importing from a folder of files, the source fields have a special name and meaning.
When you're doing a folder import, the names and contents of the source fields on the left are fixed: They depend on the type of file from which you're importing. When you're importing from text files, the source fields are called Text Content, File Name, and File Path. These fields contain, respectively, the actual text content of the field, the name of the individual file from which the data is coming, and the full name of the path to the file. As with any other data source, you can choose to import some or all of these fields, and you can choose how to map them to fields in the FileMaker table that's the target of the import.
Unlike imports from other kinds of flat-file data sources, FileMaker's batch text import brings the entire contents of each text file into a single FileMaker field.
After importing, you might have a data set that looks like the data seen in Figure 19.12.
Figure 19.12. This is a sample data set resulting from a batch import of three text files from a folder.
Importing Image Files
Importing image files from a folder is quite similar to importing text files. See Figure 19.13 for a look at the folder-import options that apply to images. As with text files, you need to choose a source folder, and decide whether to drill down into any subfolders as well.
Figure 19.13. These are the special Import Field Mapping options for importing from a folder of images.
Images or References?
In the past, FileMaker's usefulness as a tool for storing entire files (sometimes referred to as asset management) was somewhat limited by the 2GB maximum size of an individual FileMaker file. With FileMaker 7, the file size limit is reckoned in terabytes, so it's tempting to try to use FileMaker as a tool for managing large amounts of nonFileMaker data such as image files.
Still, image data can take up a great deal of storage space, and it may not make sense to try to store thousands of high-resolution images inside a FileMaker file. Accordingly, FileMaker offers you the option (when importing images from a folder), to import only a reference to each file, rather than the entire contents of the image. If you choose to import a reference, FileMaker remembers where the image is stored on disk, and refers to it when necessary in a fashion similar to the way in which Mac OS and Windows work with shortcuts and aliases.
There are some additional considerations when using container fields in conjunction with FileMaker's Instant Web Publishing: see "Container Fields," p. 607. |
The benefit of storing references is, of course, that they take up much less space in the database. The disadvantage is that if the original files are moved or renamed in any way, FileMaker will no longer be able to find them, and the images will not display in FileMaker nor be otherwise usable.
This is especially problematic if the file containing the images is hosted for multiuser access. Each user of the system needs to see the image directory via the same network path. Because Windows and Macintosh handle server paths differently, creating a unified server structure to work in both environments could be challenging.
In the end, the decision as to whether to import whole image files or just references is up to you, keeping in mind the tradeoff between the flexibility of having all images stored directly in the database, versus the increased capacity that comes from working with the file references alone.
Images Versus Thumbnails
When you import data from text files, you can bring in up to three pieces of data: the filename, the full path to the file, and the text contents of the file. With image files, it is possible to bring in four pieces of data. As with text files, you can bring in the filename and file path. You can bring in the full contents of the image file (into a container field, presumably), and you can also bring in a smaller version of the image if you choose, called a thumbnail. See Figure 19.12, shown previously, for a possible import configuration for a batch import of images.
Naturally, a full-sized image can take a lot of space, so FileMaker gives you the option of bringing in only a smaller thumbnail instead. You can bring in the thumbnail in addition to the larger image, or instead of it. (Of course, you could choose to import just the filename and path if that suited your purpose.)
Tip
FileMaker doesn't give you any control over how it creates thumbnails during the image import process. You may find that although you do want to store only a smaller copy of the image in the database, FileMaker's thumbnail process doesn't give you what you want. You might want the thumbnails a little smaller or larger, or with some kind of color adjustment. If so, you will want to experiment with creating your own thumbnails first, and import those instead.
Importing Photos from a Digital Camera
|