/* This copy appends to records if there are duplicate bates no.'s */ text pszBatesField = "BEGBATES"; text pszOCRField = "OCRFIELD"; main() { int db, fh, i; char szDirectory[256]; /* Prompt for a directory */ if (getfile("Locate destination directory", "*.*", szDirectory) == CR) { /* Just get the directory */ for (i = len(szDirectory) - 1; i >= 0; i = i - 1) { if (szDirectory[i] == '\') { szDirectory = substr(szDirectory, 1, i + 1); break; } } /* Cycle through the database */ cycle(db) { /* Put up a status message */ puts(0, 0, "Processing record " + str(docno(db)) + " of " + str(count(db))); /* Open the file */ if ((fh = open(szDirectory + db->pszBatesField + ".TXT", "a+")) <> EOF) { /* Write the OCR field */ write(fh, db->pszOCRField, len(db->pszOCRField)); /* Close the file */ close(fh); } } } }