logo-header

 
 

syntax

  • ReadLines(source, domainunit, startposition)

definition

The ReadLines(source, domainunit, startposition) function results in a data item with as domain unit the domainunit argument (the domainunit void results in a parameter). The resulting data item contains the concatenation of the values from the lines of the source parameter as strings, starting at the startposition in each line. The number of lines read is defined by the number of element of the domain unit. In the resulting string the delimiter between each value is the string representation of the tab character (\t).

The ReadLines function also results in a uint32 parameter, called ReadPos. This parameter indicates the position of the next value after the value being read by the ReadLines function, see the example.

applies to

parameter source with string value type

unit domainunit with value type from group CanBeDomainUnit

parameter startposition with uint32 value type

example

container ReadLines
{
parameter<string>  File
:  StorageName = "%projDir%/data/demand.ini"
, StorageType = "str";
unit<uint32> BDomain: nrofrows = 6;
parameter<string>  Header := ReadLines(File, void,  0);
Result = '6\t9.02\tTest\tTrue'
attribute<float32> Body (BDomain) :=
ReadLines(File, BodyDomain, Header/ReadPos);
}

demand.ini:

6 9.02 Test True      
25000 27500 11000 6100 14400 300 70
30000 32500 12000 6200 14500 320 72
35000 37500 13000 6300 14600 340 74
40000 42500 14000 6400 14700 360 76
45000 47500 15000 6500 14800 380 78
50000 52500 16000 6600 14900 400 80

 

Body:

 
25000275001100061001440030070
30000325001200062001450032072
35000375001300063001460034074
40000425001400064001470036076
45000475001500065001480038078
50000525001600066001490040080
BDomain, nr of rows = 6

see also


OBJECT VISION BV
Vrije Universiteit
De Boelelaan 1085
1081 HV Amsterdam
The Netherlands

tel: +31 (0)20 598 9083
fax:+31 (0)20 598 9904