Sample Work

The Application of Computing to Historical Documents

Previously unpublished work by M. A. Meshkot M.Sc., Ph.D., D.I.C., Dated January 1998
Copyright © 1998 M. A. Meshkot, Web published November 2003


A database structure was defined to accommodate 12 items of information taken from each Barāt of the period 1883 AD to 1932 AD. The definition allows for data entry into five tables using a simple text editor such as MS-DOS EDIT or the Windows Notepad program which are almost universally available. The raw data can be imported into any database, word-processor, SQL interface or spreadsheet package for analysis. MS-Excel was chosen as the data analysis package and some of the possibilities for data manipulation and extraction have been discussed.


Bills of exchange, Barat, credit note, sarraf, merchant banking, data structure, database, data-processing.


A Barat is a credit note, a promise to pay after a certain time. Barats were used by traders and merchants to exchange credit, often over physical distance. The intermediary who issued and cashed barats were the Sarrafs before banks took over this function. Barats were the main credit exchange facility between lunar years 1300 AH and 1351 AH.

Physically, a Barat is a high quality rectangular piece of paper 20-24 by 10-15 cm. Many trading companies had elaborately printed barats with company logos and spaces to fill-in, similar to today's bank cheques. Invariably, their old-fashioned handwriting is quite difficult to read, and requires a trained eye. Apart from a few exceptions, all barats contain the following information:

  1. Source town

  2. destination town

  3. the name of the payer, from who's credit the barat is paid, often main merchants of the time, or sarrafs (this is equivalent to today's account holder or bank)

  4. the name of the sarraf to whom the barat is sent

  5. the amount to pay

  6. the time after which payment becomes due

  7. a reference number used by the payer

  8. date of issue

  9. name and sometimes the occupation of the payee, for whom the payment is intended

Analysis of this information is clearly of great historic value because many important questions about national and international trade of the time can be answered; such as:

  1. Who were the important merchants of the time.

  2. What goods or services were the subject of trade.

  3. What years and what months in each year were merchants most active in.

  4. What towns were the important trade centres.

  5. Who were the major sarrafs of the time.

  6. How did trends in the trade of goods vary over the years.

  7. What was the most and least frequent payment period on barats.

  8. What trades flourished during each time period.

  9. Which merchants had offices in more than one town.

  10. What amounts of money were involved.

  11. How did the amount of money/credit being exchanged between merchants changed over the years.

  12. How banks became involved in trade.

  13. What currencies were used to trade in.

The Barat Database

About two years ago, a set of 6,800 barats belonging to the Ettehadieh Company[1] were found to be processed manually to extract some of their useful information. It was immediately recognized that the processing of such information can best and more accurately be done by computers. The first step was to create a database suitable for barat data.

On lengthy analysis of the information from the first 3000 barats, the database fields became clear.  Based on the total information extracted from each barats, the database fields were defined as follows, with field names shown in square brackets:

  1. Source town [SOURCE]

  2. Destination town [DESTINATION]

  3. The name of the payer, from who's credit the barat is paid, often main merchants of the time, or sarrafs [PAYER]

  4. The payer's stamp [PAYER_STAMP]

  5. The name of the sarraf to whom the barat is sent [TO]

  6. The amount to pay [AMOUNT]

  7. The time after which payment becomes due [TIME]

  8. Barat Number, a 5-digit sequential number stamped on all barats of the present set for identification and traceback, starting at 10,000 [BARNUM]

  9. The date on the Barat [DATE]

  10. Name of the payee in Three parts [TITLE, NAME and SURNAME]

  11. The occupation of the payee [PAYEE_JOB]

  12. Payee's stamp mark which distinguishes payees of the same name [PAYEE_STAMP]


The system analysis stage also revealed the following points:

  1. Since all barats are from the same private archives belonging to Mansoureh E. Nezam-Mafi, the recipient sarrafs seems to number less than five in the current set of about 6800 barats.

  2. Since the barats are received from different sources, they contain different reference numbers (belonging to the source merchant), and therefore all the barats needed to be numbered sequentially for identification, in order that the extracted information can be traced back to individual barats when necessary.

  3. On analyzing the first 3,000 barats, It seemed that the merchants from whom Ettehadieh received barats, did not number more than 60.

Sufficient computer facilities were not available at the time to allow for direct entry of data into a final database.  So a simple text-based database was designed for data entry. 

Database Language

The hand-written text on all the barats was in Farsi, but English was chosen as the database language for the following reasons:

  1. English can easily be used to exchange information with international sources of historical data,

  2. data entry could be carried out using simple text editors

  3. English is the common language to all available databases

  4. barat data can be reduced to transliterated names and numbers

  5. problems of character-set compatibility between different computer implementations of Farsi are avoided

  6. once the data has been entered, the database can be translated into another language or made multi-lingual.


Relational Database

The description for the relationship between the PAYER and the PAYEE is that of "Few to Many". Hence from a database design point of view, PAYER and PAYEE details must reside in different tables in order to avoid data entry repetition.  To achieve this, a numeric code was assigned to each payee.  However, it was found that many different payees have the same name and can only be distinguished by their differing characteristic ink stamp wording/pattern, often from their personal ring, which was placed on the back of the barat when the amount was received by the payee.

Some of the extracted information is converted into codes. For example, SOURCE is converted to a 3-character code, named SOURCE_CODE and DESTINATION is converted to DESTIN_CODE. The defined codes are intermediaries between the source data and the master data table (table 1). They provide for reduced errors during data entry, and for a reduction in the volume of data entered. For example, if a payee's details [TITLE, NAME SURNAME, PAYEE_JOB and STAMP] are linked to a PAYEE_CODE, then that code can be linked to all barats received by the same payee instead of repeating the full payee's details. Code definitions also provide for a logical relational database structure and the collecting together of similar data such as town names, payees, and payers in separate data tables.

The reading and extraction of 12 items of information from each barat is a difficult and demanding task that requires extreme patience and accuracy in order to ensure data integrity and reliability. The validity of any statement or conclusion based on this database depends on it.  Therefore many random and systematic checks were made to ensure data integrity.

Software Selection

In consideration of the above, a simple text editor, such as the  MS-DOS EDIT program was selected as the first data entry program because of its simplicity and universal  compatibility with database and spreadsheet software.

A plain-text database was designed for the Edit program containing fields for all the relevant information from a barat. In Edit, the data fields are separated by tabs.  All the database fields and their positioning is described in tables 1 to 5.

Barat data, as entered in accordance with the database structure described by the five tables below, provide the raw data input for powerful software packages. As a result of the exact data format descriptors, the raw data can be imported into any database package, spreadsheet package or used through any SQL interface.

Since modern database and spreadsheet packages have a functional overlap, it is sometimes debatable which package type is best suited for a particular application. In this case, the operations most required are: sorting ability, filtering ability, statistical analysis of numerical data and chart generation. In consideration of these requirements (as different from data integrity checking, entry form generation and tabular form report generation) spreadsheets with database capabilities were preferred to a database with spreadsheet facilities, and Microsoft Excel was selected as the specific spreadsheet package because of its data filtering and pivot-table functions.


Data Analysis Possibilities

Microsoft Excel is an efficient and powerful toolfor the required analysis on this type of data. Furthermore, filters and sorting can be used to spot any obvious data entry faults. For example, if one column of the raw database is to contain numbers only, then non-numbers can be identified by filtering or sorting.

Filtering can also be used to extract barats with any specified criteria. For example all the barats relating to a particular year, and originating in a specified town can be extracted.

Logical operations (AND, OR, NOT) can also be carried out using a number of fields. For example, all the barats containing more than 1000 Tumans AND instructed for immediate payment AND issued on the 3rd OR 9th month of the year AND being paid to a particular merchant can be extracted.

Once extracted, the sum, average, maximum, minimum, variance, standard deviation... of any numerical fields can be calculated.

Two-dimensional and Three-dimensional charts can be produced to show for example, the variation of trade done by a given merchant over a number of years, or the variation of trade with one merchant over a number of years in relation to other merchants. The variation in trade between any two merchants over the years can also be charted.

Once trading partners are identified from the number of barats exchanged between them, then the amount of trade between them, and in relation to other trading partners, can be traced over a specified number of years.

The above are examples of what can be done by importing raw barat data into MS-Excel.


Database Definition

Table 1 shows the basic data structure for the simple text-based barat database.  The key field is the barat number [BARNUM] and the coded fields like [SOURCE_CODE] and [DESTIN_CODE] are fields which link the data to other tables.

Table 1 - Definition of the BARATnn.TXT file, where nn is a plain text file version number

Field NameField Type Start PositionField Length Description 
BARNUMNumeric15Barat Number.  The 5-digit sequential number stamped on all barats of the present set to identify each one, starting at 10000
DATENumeric910The lunar date in the international date format YYYY-MM-DD.  Where the month and day are not indicated, the value 00 is entered.
SOURCE_CODEAlphanumeric253Source Town.  A 3-character code indicating the town in which the barat was issued.  International airline codes are used where available.
DESTIN_CODEAlphanumeric333Destination Town.   A 3-character code indicating the town in which the barat is received.  International airline codes are used where available.
TO_CODEAlphanumeric412A 2-character code indicating the name of the sarraf to whom the barat is sent.  For example ET for the Ettehadieh Company .
AMOUNTAlphanumeric497The amount to be paid as stated on the barat.  Where units other than Tumans are used, this is indicated by an appropriate additional character following the amount.  For example: M for Manat, L for Osmani Liera (Turkish), F for Franks, P for pounds
TIMENumeric573The time (days) after which payment becomes due.  Zero is entered for immediate payment
PAYEE_CODENumeric654A 4-digit sequential code identifying the final recipient of the barat amount, starting at 1000.
PAYER_CODEAlphanumeric732A 2-character alphabetic abbreviation code by which the payer is identified. 


It is clear from the coded fields of Table 1, that Four other linked tables are required to describe the full database structure.  These are tables to link the coded fields of the above table to the actual data.  For example, a table is required to show that when the [SOURCE_CODE] field has THR, it means TEHRAN. The four tables are described below:

Table 2 - Definition of the TOWNnn.TXT file, where nn is a plain text file version number

Field NameField Type Start PositionField Length Description 
TOWN_CODEAlphanumeric13A 3-character code used to identify the source and destination towns. International airline codes are used where available.
TOWNAlphanumeric930Full town name.


Table 3 - Definition of the PAYERnn.TXT file, where nn is a plain text file version number

Field NameField Type Start PositionField Length Description
PAYER_NUMNumeric13A sequential number assigned each payers. This number is not intended to be a database key.
PAYERAlphanumeric938The full name of the payer, or the issuing company.  The different parts of the name are hyphenated, such as Title-Firstname-Middlename-Lastname
PAYER_CODEAlphanumeric493A 3-character alphabetic abbreviation code by which the payer is identified.
PAYER_STAMPAlphanumeric5740The payer identification stamp. This field is left blank where the stamp wording is identical to the payer's name.


Table 4 - Definition of the PAYEEnn.TXT file, where nn is a plain text file version number

Field NameField Type Start PositionField Length Description 
PAYEE_CODENumeric14A 4-digit sequential code identifying the final recipient of the money, starting at 1000.
TITLEAlphanumeric920Payee's title, or the first part of his full name.
NAMEAlphanumeric3322The middle part of the Payee's name.
SURNAMEAlphanumeric5713Payee's surname, often indicating his town of origin.
PAYEE_JOBAlphanumeric7313Payee's occupation where stated on the barat
PAYEE_STAMPAlphanumeric8930Text of the payee's unique ink stamp pattern, indicating that the barat amount has been received by the payee. This stamp also distinguished the payee from others of the same name.


Table 5 - Definition of the TOnn.TXT file, where nn is a plain text file version number

Field NameField Type Start PositionField Length Description 
TO_CODEAlphanumeric12A 2-character code indicating the name of the sarraf to whom the barat is sent. For example ET for the Ettehadieh Company .
TOAlphanumeric930The sarraf's full name or company name.


The Five tables 1-5 together, provide a complete description of the unformatted and universally compatible database.



Sufficient information was extracted from 6800 barats and entered in a database to enable the most important information from each one to be reproduced in text form.

Now that the very difficult stage of data entry is almost complete, important information about the economic state of Persia, economic trends, trade, merchants, banks and most used currencies can be extracted from the barat information that has been entered in the database described in this paper.

The database described in this work has the unlimited ability to be filled with more similar data, which in turn increases the reliability of conclusions based on the statistical analysis. Therefore if barats from other sarrafs or merchants are entered in the same format into this database or a database with the same structure,  then by combining databases, an even more complete and accurate picture of the economic life of the period will emerge.

The type of database definition described in this article is not limited to barats. It can be applied to any collection of information wherein a sentence structure is not of primary importance.

Update May 2003

Since creating the above database, data has been extracted from all the barats and entered into the database.  The text-based database was imported into Microsoft Excel and further data entry took place in the more user-friendly Excel environment.

The data was analysed and a paper based on the analysis was published by Dr. Ettehadieh [2] in 1999.  The task of reading all the barats and entering their data was performed by Fariba Afrashteh.



[1]  For more information on the Ettehadieh family, see M. Ettehadieh Nezam-Mafi, "Masā'el-e Sarrāfi az Khelāl-e Sotur-e Nāmeh-hā-ye Yek Sarrāf" in Yādegār Nāmeh-ye E. Fakhrā'i, ed. R. Rezazadeh-ye Langerudi, Tehran 1370 HŜ/1991, pp 315-338.

[2]Ettehadieh, M., "Merchant Banking in the Late Nineteenth Century" Studia Iranica, Cahier 21, pp329-345, 1999.



Click on the thumbnail images below to enlarge.

Sample barat or bill of exchange (Front)
Sample barat or bill of exchange (Back)
Chart 1 from reference [2]
Chart 7 from reference [2]


The above database was designed from scratch after a systems analysis of the way barat information was being manually processed.  If you have old bills of exchange or other historical documents, I can look at how information is being processed at present, and advise on better automated methods of data analysis.  My next project on the computer analysis of historical documents is to look at the detailed Tehran census of 1853 AD and 1899 AD (1269 AH and  1317 AH) . If you are interested in this project, then please let me know, as this will encourage me to spend more time on it.

Please click on the link below to return to the English Home Page

If you require some further information, Please Contact Me

Return to English Home Page

Return to Work Samples

Copyright © 1998 Dr. M. A. Meshkot
This page was last updated May 2004