64 Excel
Having seen some of the issues involved in using a text fi le, you are ready
to try importing data from a text fi le. In this example, a family-owned bagel
shop has gathered data on wheat products that people eat as snacks or for
breakfast. The family members intend to compare these products with the
products that they sell. The data have been stored in a text fi le, Wheat.txt,
shown in Table 2-5. The fi le was obtained from the nutritional information
on the packages of the competing wheat products.
Table 2-5 Wheat Data
Brand Food Price Total
Oz.
Serving
Grams
Calories Protein Carbo Fiber Sugar Fat
SNYDER PRETZEL 2.19 9.0 31.0 120 3 25 1 1 1.0
LENDERS BAGEL 1.39 17.1 81.0 210 7 43 2 3 1.5
BAYS ENG
MUFFIN
2.27 12.0 57.0 140 5 27 1 2 1.5
THOMAS ENG
MUFFIN
2.94 12.0 57.0 120 4 25 1 1 1.0
QUAKER OAT
SQUARES
CEREAL
5.49 24.0 57.0 210 6 44 5 10 2.5
NABISCO GRAH
CRACKER
3.17 14.4 31.0 130 2 24 1 7 3.0
WHEATIES CEREAL 5.09 15.6 27.0 100 3 22 3 4 1.5
WONDER BREAD 0.99 20.0 26.0 60 2 13 0 2 1.5
BROWNBERRY BREAD 3.49 24.0 43.0 120 4 23 1 3 2.0
PEPPERIDGE BREAD 2.89 16.0 25.5 70 2 13 1 2 1.0
To start importing Wheat.txt into an Excel workbook:
1 Click the Offi ce button and then click Open.
2 Navigate to the Chapter02 data folder and change the fi le type to
Text Files (*.pm; *.txt; *.csv).
Excel displays the file wheat.txt from the list of text files in the
Chapter02 folder.
3 Double-click the wheat.txt fi le.
Excel displays the Text Import Wizard to help you select the text to
import. See Figure 2-22.