previous up next contents
Previous: A.1 The main program Up: A. Some computing tools Next: A.3 Encoding / decoding   Contents

A.2 Reading data files

LISTING 3 describes how data files are read and preprocessed. Reading is transferring, line by line, the contents of the file into a (column) matrix of strings named rep. Preprocessing is a two steps process. First typographical corrections are done (e.g. inter-words spaces " " are converted into "_" while french "," are converted into decimal point "." and separators ";" are converted into scilab separators ",".


\begin{algorithm}
% latex2html id marker 1432
[!tbph]
\begin{algorithmic}[1]
\pa...
...\end{algorithmic}
\par
\caption{Data reading and shaping
}
\par
\end{algorithm}

Thereafter, lines are split into words, that are stored into a rectangular matrix named datas. When something turns wrong, row size of datas is less than row size of rep. This indicates that grouping into blocks has failed somewhere, attempting to produce lines of various lengths.

If necessary, datas is reorganized : lines (except from the first) are chronologically sorted and the column of results is moved to the last place.

In a last step (LISTING 4), the factors are identified and their levels are read and sorted (in scilab order). Thus: moda(3)= ! brass silver CuNiSn !


\begin{algorithm}
% latex2html id marker 1465
[H]
\begin{algorithmic}[1]
\par
\D...
...r
\end{algorithmic}
\par
\caption{Factors and modalities
}
\par
\end{algorithm}


previous up next contents
Previous: A.1 The main program Up: A. Some computing tools Next: A.3 Encoding / decoding   Contents


douillet@ensait.fr
2008-03-13