PANDORE Version 6 GREYC-IMAGE

ptxt2col



Builds a collection from text file.



Synopsis

ptxt2col filename [col_out|-]

Description

ptxt2col creates the collection col_out from a value or an array of values given in the input text file. For a value, the text file has the following structure:

   Type name value

For example:

   Float pi 3.141592

For an array, the text file has the following structure:

   Array:type name values

For example:

   Array:Ushort iota 1 2 3 4 5 6 7
   Array:Char hop 15 34 x 6 56 72 78

This example creates a collection with two arrays: the array iota that contains 7 Ushort and the array hop that contains 10 Char. (34 x 6 indicates that 34 is repeated 6 times.)

Notice: strings are defined by the type Array:Char and follows the structure:

   Array:Char name value

For example:

   Array:Char my_string hello_word

Inputs

Outputs

Result

Returns SUCCESS or FAILURE.

Examples

Creates the collection col.pan from the text file a.txt:

   ptxt2col a.txt col.pan

See also

Collection, pcol2txt

C++ prototype

Errc PTxt2Col( const std::string &filename, Collection &col_out );

Version française

Construction d'une collection à partir d'un fichier texte.


Author: Alexandre Duret-Lutz