Bulk loading is accomplished by creating a text file containing data and then reading it in to the database.
As you gain experience, it will be advantageous to learn a scripting language like Perl. The up-front effort required to learn Perl is more than amply rewarded by the increase in productivity. In comparison with other programming languages, Perl is easy to learn. The Perl interpreter is free and can be downloaded from a variety of sites.
chromosome1.ace Image.captions.ace papers_from_1993.ace 2-point-data.ace new_people.ace MY_TSHIRTS.aceWhen ACEDB lists the contents of $ACEDB_DATA (i.e., "rawdata"), by default it only shows files with a ".ace" suffix.
The model for any class specifies the class name plus fields and field labels. This structure is "cloned" to create real independent objects. The organization of the data file reflects these principles.
For example, consider this data which describes two t-shirts:
TShirt sam1 Price 15.95 Damage "bleach marks" "5 March 1992" TShirt sam2 Borrowed_by "Sarah Edmunds" Source "Dead Concert" //end of my t-shirt file (last modified 2 March 1994)
?TShirt Price Float
Damage Text Text // description and date
You cannot say
Price 15.95 "a bargain"because there is no place for "a bargain" in the model. You cannot say
Price "fifteen dollars"because "fifteen dollars" is not a decimal (floating point) number. It would be permitted but incorrect to say
Damage "5 March 1992" "bleach marks"if you were intending to use the first field for the damage description and the second for the date.
Damage Text Text //the model
| |
| |
| |
Damage "Hi!" "Bye!" //the data
Unfortunately this is not:
Damage Text Text //the model
/
/
/
Damage "Bye!" //the data
Null (blank) values will work for Text fields, but see this note before using them.
Remarks "He said "I have two cats!""should be converted to one of the following
Remarks "He said 'I have two cats!'" Remarks "He said ''I have two cats!''"Hopefully the need for this will disappear in future versions of the software.

Next, you must select "Read .ace files" on the main window menu which will present the ".ace file parser". Clicking the "Open File" button will lead to a second window titled "Which ace file do you wish to parse?". Make your selection by double-clicking a filename (or by clicking the filename once, then the "OK" button). The "Which ace file..." window will disappear. At this point ACEDB is poised to read the file and will attempt to read it in (in entirety) when you click the "Read all" button in the ".ace file parser" window. (The other buttons allow you to step through a data file and are useful for troubleshooting).

As reading occurs, the Item (i.e., object) and Line numbers will reflect ACEDB's progress through the file. Errors of the sort noted earlier will stop the process with an informational message. This one is due to the fact that the ?TShirt model does not have a "Note" label:

Once you click "Continue" you will have the opportunity to continue reading (ACEDB will skip over the error) or abort the read.
When ACEDB reaches the end of the file, the new objects are immediately available for inspection via the selection list. However, they are not permanent until you save (main window menu).
It is perfectly legal to read in the same data file repeatedly. ACEDB will ignore whatever it already "knows" about and detect any changes you have made. However, ACEDB will not delete information simply because you have removed it from the file; for this task you need to become familiar with another .ace file option and the "acediff" tool.
acedb> parse rawdata/test.ace // 4 objects read with 0 errors// 4 Active Objects acedb>The difference between parse and pparse is: the former halts the load as soon as an error is encountered, while the latter reports the error, skips the affected object, and continues. The errors are written into the database log file for reference later.
#!/bin/csh setenv ACEDB_NO_BANNER setenv ACEDB /rusty/dbs/testdb /rusty/dbs/acedb/bin/tace << END pparse rawdata/test.ace list quit ENDand then load the database by executing the script. Many variations on this theme can be implemented to support complex database management tasks or interface to processes generating data. The aceserver, along with an appropriate client, is even more versatile because it permits a two-way conversation with the database.
Back to Table of Contents