How to ASCII Import Multi-line fields Fields Into PastPerfect Museum Software

John H. Yates
Last Update: Thu Nov 17 11:02 EST 2016

This brief note documents how to ASCII import Multi-line fields into PastPerfect. As delivered, PastPerfect cannot do this. Currently, ASCII import into PastPerfect requires that each record be only on a single line.

PastPerfect is also currently unable to ASCII export records and subsequently import that very file if any fields have multiple line fields.

I consider the lack of this feature a serious shortcoming of the program.

I describe here how to accomplish a work around, and have suggested to PastPerfect that they code the below into their program. That is, during export replace carriage return line feeds with a special ASCII string, output the ASCII record on one line, and then when imported, check for that unqiue string, and replace it with an actual carriage return line feed. That should be no more than hours work for a good programmer. I won't tell you how many hours it took me to develp this work around. It takes many hours to learn what eventually becomes simple and trivial! That is why I post it here, to save others that time.

In a production conversion program I wrote for importing data into PastPerfect I was forced to design a work around for this.

Whenever I had a field like STERMS, PEOPLE, DESCRIP, where fields are designed and even required to be multiple lines, I simply put the string where the carriage return line feed belongs. This kept the import record to one line, as the current PastPerfect requires.

Then, once imported into PP these strings must be replaced with the Utility Global Update.

And since the CRLF can't be successfully keyed into the "replace with" field, open the window "Open Command Window" found in the lower left of the Global Update window.

Type the following commands and submit them individually: (be sure that "Command executed successfully" appears after each submit. If an error, it must be fixed. Usually it is because of mistyping something in the command. The syntax is very strict).

USE c:\pp5\data\ARCHIVES

You can determine where the ARCHIVES table is, c:\pp5\data\ above, on your system. The data directory for the tables can be found in Utilities -> System.)

If you have a shared z: network drive setup, the directory will be something like \\someserver\pp5\data. In that case, the USE command will look like:

USE \\someserver\pp5\data\ARCHIVES

If that fails, your network system administrator may have set permissions to allow the computer you are on to access that area. To check, enter "cmd" in the run window, double click on the "cmd" program that will be shown, and this opens essentially a DOS window. Type:

NET USE

and see if \\someserver\pp5\data is in the list of network drives you have access to. If it isn't contact your network administrator. In my case, it was simply a matter of moving to another computer that had access to that directory.

In my case, I was importing only into the ARCHIVES database. You can easily see how to handle the other databases, e.g. OBJECTS, etc., if necessary.

Now do:

REPLACE ALL DESCRIP WITH strtran(DESCRIP, "", chr(13)+chr(10))
REPLACE ALL STERMS WITH strtran(STERMS, "", chr(13)+chr(10))
REPLACE ALL PEOPLE WITH strtran(PEOPLE, "", chr(13)+chr(10))

Then to be "safe" do a REINDEX,

then click on RESEARCH -> By Keyword and click on "Rebuild indexes now".

then go to:

SETUP -> Authority Files -> Common Screens -> Search Terms

(double click on "Search Terms"), then click on Remove Unused Terms. This will remove the search terms that have embedded in them if they happened to be indexed before you replaces the strings.

=======================================================================

Other useful commands:

One may filter IMPORT/EXPORT data by, e.g.:

accessno="1500"

And one may delete many entries, say all 1500, by:

DELETE FROM ARCHIVES WHERE ACCESSNO="1500"

=======================================================================

The above process was learned from posts found here. Thanks!

=======================================================================