Part III: More-Advanced Access Techniques
596
Linking to text files
A far more common situation than linking to HTML files is linking to data stored in plain text files.
Most applications, including Microsoft Word and Excel, are able to publish data in a variety of text
formats. The most common formats you’re likely to encounter are
l Fixed width: In a fixed-width text file, each line represents one row of a database table.
Each field within a line occupies exactly the same number of characters as the correspond-
ing field in the lines above and below the current line. For example, a Last Name field in
a fixed-width text file might occupy 20 characters, while a phone number field may only
use 10 or 15 characters. Each data field is padded with spaces to the right to fill out the
width allocated to the field. Figure 16.11 shows a typical fixed-width file open in
Windows Notepad.
FIGURE 16.11
A typical fixed-width text file
l (^) Comma-separated values (CSV): Comma-separated values are somewhat more difficult
to understand than fixed width. Each field is separated from the other fields by a comma
character (,), and each field occupies as much space is necessary to contain the data.
Generally speaking, there is little blank space between fields in a CSV file. The advantage
of CSV files is that the data can be contained in a smaller file because each field occupies
only as much disk space as necessary to contain the data.
CSV files can be difficult to read when opened in Windows Notepad. Figure 16.12 shows
a typical CSV text file.
FIGURE 16.12
CSV data is more compact than fixed-width text, but it’s more difficult to read.