14. Importing and Exporting Bento Data and Libraries

This chapter shows you how to share your Bento data and libraries by importing and exporting them.

Importing and Exporting Basics

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 into an Existing Bento Library

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.

image

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.)

image LET ME TRY IT

Create a New Table for Imported Data
  1. Create the new table as shown in Figure 14.2.

    Figure 14.2. Create the Bento table.

    image

  2. Add the first three text fields: Title, Pages, and Figures.
  3. Add a calculation field for Chapter Pages. Title is a text field; Pages and Figures are number fields. The Chapter Pages field is a calculation field (shown in Figure 14.3).

    Figure 14.3. Use a calculation for the Chapter Pages field.

    image

  4. Choose File > Import > File to open the Import dialog, as shown in Figure 14.4. You can select a Numbers or Excel spreadsheet as well as a text file with comma or tab delimiters. This example shows the use of a CSV file because it is very slightly more complicated that importing from a spreadsheet.

    Figure 14.4. Select import settings.

    image

  5. If Bento senses that the first record of the file contains field names (Bento) or column headings (spreadsheet), it attempts to match them. If there is not an exact match between a column heading in the spreadsheet and a Bento field name, Bento does not import the data by default. However, you can use the pop-up menu to refine the import settings, as shown in Figure 14.5.

    Figure 14.5. Modify field import settings.

    image

    Tip

    You can also use the double-headed arrows to rearrange the sequence of the imported fields.

  6. As pointed out in Chapter 4, you can adjust the starting record and decide if you want the starting record to be used as titles.

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.

image

Show Me: Media 14.1—A video about creating a new table for imported data

image

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).

Show Me: Media 14.2—A video about importing data by pasting into table view

image

Access this video file through your registered Web Edition at my.safaribooksonline.com/9780131388611/media.

image LET ME TRY IT

Exporting Bento Data

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.

  1. Choose File > Export to export a file from the current library.

    Your export options (Numbers, Excel, Text, and Template) are shown in Figure 14.7.

    Figure 14.7. Bento has a number of export options.

    image

  2. Whether you are exporting to Numbers, Excel, or a text file, your first choice is whether to select all records in the Bento library or just the current records (those you have found as the result of a search).
  3. In addition, you can choose to export all the library’s fields or just those shown in the table view.
  4. If you are exporting text data, you can choose the delimiter, as shown in Figure 14.8.

    Figure 14.8. Choose the delimiter for text data exports.

    image

  5. Click Next. You will be asked to choose a file name. Click Save and Bento does the rest.

Show Me: Media 14.3—A video about exporting Bento data

image

Access this video file through your registered Web Edition at my.safaribooksonline.com/9780131388611/media.

Note

Related records are not exported from Bento.

Importing and Exporting Libraries

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 Bento Libraries as Templates

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.

image

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 Bento Libraries as Templates

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.

Tell Me More: Media 14.4—A discussion about design considerations for templates

image

Access this video file through your registered Web Edition at my.safaribooksonline.com/9780131388611/media.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.193.106