Raw data records often contain missing or inconsistent items. Estimatingthe value of those items is usually complicated by restrictions imposed on possible value combinations. In this paper a method is described with which missing values can be estimated for categorical data, while restrictions on value combinations are obeyed. It is also possible to draw random values. The method is based on performing random walks on the set of all possible datafiles of records which obey the restrictions.