Microsoft Office Tutorials and References
In Depth Information
AC 218
Access Integration Feature Sharing Data Among Applications
Text Files
Te x t fi les contain unformatted characters including both readable characters, such
as numbers and letters, and some special characters, such as tabs, carriage returns, and line
feeds. Typical extensions for text fi les that can be imported or linked into Access databases
are txt, csv, asc, and tab.
To be able to use a text fi le for importing or linking, it must be organized into
records (rows) and fi elds (columns). Records and fi elds can be organized in two ways:
delimited fi les and fi xed-width fi les.
In delimited fi les , each record is on a separate line and the fi elds are separated by
a special character, called the delimiter . Common delimiters are tabs, semicolon,
commas, and spaces. You also can choose any other value that does not appear within the fi eld
contents. The csv (comma separated values) fi le often used in Excel is an example of a
delimited fi le.
In fi xed-width fi les , the width of any fi eld is the same on every record. For example,
if the width of the fi rst fi eld on the fi rst record is 12 characters, the width of the fi rst fi eld on
every other record also must be 12 characters.
Identify sources of external data for the database: text fi le.
You need to decide whether it is appropriate for you to use external data stored in a text
fi le. The following are some common reasons for using a text fi le for this purpose:
1. Data that you want to import is not available in a format that Access recognizes. You fi rst
would export the data from the original application to a text fi le and then import that
text fi le into Access.
2. You manage data in Access but regularly receive data in text fi les from other users that
needs to be incorporated into your database.
Determine whether the data you have identifi ed is in an appropriate format:
text fi le.
Before importing or linking the text fi le you have identifi ed, you need to make sure it is in
an appropriate format. The following are some of the actions you should take to ensure
correct format:
1. Make sure the data in the text fi le consistently follows one of the available formats
(delimited or fi xed width). If the fi le is delimited, identify the delimiter and make sure
the same one is used throughout. If the fi le is fi xed-width, make sure each fi eld on each
record is the same width.
2. Make sure that there are no blank records within the fi le. If there are, remove them prior
to importing or linking.
3. Make sure there are no blank fi elds within the list. If there are, remove them prior to
importing or linking.
4. For each fi eld, make sure the entries in each record represent the same type of data.
5. If it is a delimited fi le, determine whether the fi rst row contains column headings that will
make appropriate fi eld names in the resulting table. If not, you should add such a row.
In general, the process is simpler if the fi rst row in a delimited fi le contains appropriate
column headings.
6. Make sure there are no extra paragraph (carriage) returns at the end of the fi le. If there
are, remove them prior to importing or linking.
Search JabSto ::

Custom Search