This chapter shows you how to share your Bento data and libraries by importing and exporting them.
One of the key features of Bento is the ease with which data can be imported and exported. In Chapter 4, “Building a Bento Library from Your Own Data,” you saw how to take a data file and import it into Bento, automatically creating a new table from the data. It is a simple process that can quickly bring legacy data, data from the Web, or any other data in a supported format into Bento.
Bento supports input formats including spreadsheets from Excel and Numbers (part of iWork) as well as tab-delimited files such as those from AppleWorks along with comma-separated-value (CSV) files. And, as noted in Chapter 4, if you happen to have data that is in yet another format, you frequently can export it in an intermediate format to a third application and, from there, save it or export it in a supported format.
This chapter expands on Chapter 4 by showing you how to import data into an existing library; it also shows you how to export data from Bento. You also learn to export not just the data, but an entire Bento library including its forms.
Importing data has a number of variations:
• You may have a Bento table with no data and you want to import data from an external file.
• Your Bento table may have some data already and you want to add data with your import.
• Your Bento table may or may not have some data, and it may have some fields. With your import, you want to add new fields and data for them.
The process described in this section applies to all these variations.
The example used in this section is a familiar task for authors and editors of books: It can be summed up in the question, “How is the page count coming?” In addition to all the other considerations in writing a book, this is something that needs to be managed so that the book comes in on target. Because books are usually written with word-processing software such as Microsoft Word or Pages and because the figures and illustrations are created separately from the text, it is important to find a way to approximate the number of printed pages in each chapter.
For many book layouts, a simple formula is used:
• One word-processing page is approximately one laid-out page in a book. (In fact, many authors and publishers use word styles that have fonts, font size, and margins that make this approximation more accurate. A page typed in Helvetica 42 will not wind up being anywhere close to a laid-out page in a standard book font.)
• One figure with its caption, figure number, and white-space margins above and below is approximately half or a third of a laid-out page.
For a book of several hundred pages, this formula is reasonably accurate, at least for the purposes of tracking page count until the pages are actually laid out. For any individual page, it may be somewhat off. Authors and editors frequently keep track of page count with a spreadsheet, such as the one shown in Figure 14.1. Note that the Total column is a calculation that allocates a third of a page to each figure.
Figure 14.1. Page count data in a Numbers spreadsheet.
Here is one way to import data from the external data source into a Bento table with no data. (You can compare this to the import procedure described in Chapter 4 where the table was automatically created from the data.)
LET ME TRY IT
Figure 14.2. Create the Bento table.
Figure 14.3. Use a calculation for the Chapter Pages field.
Figure 14.4. Select import settings.
Figure 14.5. Modify field import settings.
Figure 14.6 shows the imported data. Note that the appropriate columns are summarized by showing the summary row.
Figure 14.6. Select import settings.
Access this video file through your registered Web Edition at my.safaribooksonline.com/9780131388611/media.
You can also copy and paste data into a Bento table view. Select the part of the spreadsheet you want to use and then copy it to the Clipboard as you normally would do. Then, in the Bento table view, click in the cell that you want to be the upper left cell of the imported data—then paste the data. Rows and columns can then be added manually as needed. In most cases, you do not want to add columns in this way, so the upper left cell of your imported data is in the appropriate column (that is, a Pages spreadsheet cell in the Pages column of the blank row of the Bento table view).
Access this video file through your registered Web Edition at my.safaribooksonline.com/9780131388611/media.
LET ME TRY IT
You often want to go in the other direction—exporting data from Bento to another format. You might do this to share your data with someone who doesn’t have Bento, for example.
Your export options (Numbers, Excel, Text, and Template) are shown in Figure 14.7.
Figure 14.7. Bento has a number of export options.
Figure 14.8. Choose the delimiter for text data exports.
Access this video file through your registered Web Edition at my.safaribooksonline.com/9780131388611/media.
You can import and export libraries as templates. This lets you share your both your library structure (including forms and related libraries) with others.
Templates also make possible the Bento Template Exchange, described in Chapter 15.
Exporting a Bento library as a template starts with File > Export. Choose the Template tab at the top to open the dialog, as shown in Figure 14.9.
Figure 14.9. Export a Bento library.
Unlike exporting to a file, when you export a Bento library template, you can include related tables. When you have selected any related tables, click Next; you are asked to select a name for the file, and that is all you have to do.
Importing is just as easy as exporting. Choose File > Import > Template and then select the template file to import. Click Open, and the library (or libraries) are imported into Bento. You can start to use them right away.
3.145.193.106