2
<!--Copyright 1997-2002 by Sleepycat Software, Inc.-->
3
<!--All rights reserved.-->
4
<!--See the file LICENSE for redistribution information.-->
7
<title>Berkeley DB Reference Guide: Loading text into databases</title>
8
<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
9
<meta name="keywords" content="embedded,database,programmatic,toolkit,b+tree,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,java,C,C++">
12
<a name="2"><!--meow--></a>
13
<table width="100%"><tr valign=top>
14
<td><h3><dl><dt>Berkeley DB Reference Guide:<dd>Dumping and Reloading</dl></h3></td>
15
<td align=right><a href="../../ref/dumpload/format.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../../reftoc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../../ref/install/file.html"><img src="../../images/next.gif" alt="Next"></a>
18
<h1 align=center>Loading text into databases</h1>
19
<p>The <a href="../../utility/db_load.html">db_load</a> utility can be used to load text into databases.
20
The <b>-T</b> option permits nondatabase applications to create
21
flat-text files that are then loaded into databases for fast,
22
highly-concurrent access. For example, the following command loads the
23
standard UNIX <b>/etc/passwd</b> file into a database, with the login
24
name as the key item and the entire password entry as the data item:
25
<p><blockquote><pre>awk -F: '{print $1; print $0}' < /etc/passwd |\
26
sed 's/\\/\\\\/g' | db_load -T -t hash passwd.db</pre></blockquote>
27
<p>Note that backslash characters naturally occurring in the text are escaped
28
to avoid interpretation as escape characters by <a href="../../utility/db_load.html">db_load</a>.
29
<table width="100%"><tr><td><br></td><td align=right><a href="../../ref/dumpload/format.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../../reftoc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../../ref/install/file.html"><img src="../../images/next.gif" alt="Next"></a>
31
<p><font size=1><a href="http://www.sleepycat.com">Copyright Sleepycat Software</a></font>