VECTOR/READ using MATCH

* VECTOR/READ VLIST FNAME [ FORMAT OPT MATCH ]

1 V/READ X,Y,Z match.dat 6x,3(F4.1) ! /Data/ v/draw X v/draw Y ! S v/draw Z ! S

match.dat

2 Title: File used for tests of the MATCH parameter in V/READ Data : 1.0 2.0 3.0 Data : 2.0 3.0 4.0 Data : 3.0 4.0 5.0 Data : 4.0 5.0 6.0 2 This line will be ignored by a V/READ with MATCH Data : 5.0 6.0 7.0 Data : 6.0 7.0 8.0 Data : 7.0 8.0 9.0 Data : 8.0 9.0 1.0 Data : 9.0 1.0 2.0 2 End
This example shows how the MATCH parameter can be used in order to read only a subset of a file. MATCH is used to specify a pattern string, restricting the vector filling only to the records in the file which verify the pattern. Example of patterns:

  1. When the MATCH parameter is used, the command V/READ reads the file in two passes:
    1. to find how many lines should be read in order to create vectors with the proper length.
    2. to read the lines where the MATCH parameter is found.
  2. these lines are skipped during the reading pass.



Last update: 96/05/24 17.19
Olivier.Couet@Cern.Ch