Skip to content
This repository was archived by the owner on Dec 28, 2022. It is now read-only.

Grepping data

Erik Ramfelt edited this page Feb 19, 2019 · 2 revisions

Grep command is a command that will extract certain data from the component file in similar to the common grep linux tool. This can be used to automatically create CSV files containing data such as VCID, property values, etc.

Usage

Grep works with the following keywords:

  • $value.Vcid VCID
  • $value.DetailedRevision Detailed revision
  • $tags Comma separated string of tags
  • $var[PROPERTY_NAME] Value of a named property
  • $note[NOTE_NAME] Value of a named Note
  • $file File path

As Grep is using Velocity it is possible to have logic within the grep command. See the documentation for velocity for more details.

Samples

Extracting VCID, and property value from components

To extract the VCID, name and the property Conveyor Length from the components, do the following: java -jar app.jar grep -g "$value.VcId; $var[\"ConveyorLength\"]; $item[\"Name\"]"

Output from the app will be in the C:\Users\Public\Documents\Visual Components\4.1\Models\eCatalog 4.1\Components\Visual Components\Feeders folder

92e88fdf-ee4e-46ac-991f-31bdf496b7da; 600; Advanced Feeder (old)
145d4170-ef1a-4b4c-8a71-b82c855b0218; 600; Advanced Feeder
10ef8ec1-6a5a-4006-b8c9-2bf93d5928fd; 500; Basic Feeder
e6254169-b37f-4ecd-afe6-572cbc5646db; 1200; Pattern Feeder
77791ef3-a680-42f5-ac61-dec5e2309e4a; 500; Shape Feeder
64c1173c-1adc-4869-b5d5-ef8d3ab7a28b; 500; Signal Feeder

Extracting property list values

To extract the values of a list property do the following:

java -jar app.jar grep -g "$value.VcId; $var[\"SignalActions::ReleaseToPhysics\"]; [#foreach($v in $var[\"SignalActions::ReleaseToPhysics\"].Set)$v$#if($foreach.hasNext),#end#end]"

Output from the app will be in the C:\Users\Public\Documents\Visual Components\4.1\Models\eCatalog 4.1\Components\Universal Robots\Robots folder

c501624c-d87f-4583-85b7-749ac71a96e7; Never; [Never,If Target not Detected,Always]
91e2fb60-b585-4c86-a0cc-e8edf109eb0f; Never; [Never,If Target not Detected,Always]
a4a4a85b-775a-4faa-9872-e5240eb2e088; Never; [Never,If Target not Detected,Always]
e947849d-6071-448a-bb60-84f01561a447; Never; [Never,If Target not Detected,Always]
7ac57c2a-3993-4fe5-ae27-552d249ab880; Never; [Never,If Target not Detected,Always]
543478b3-b4de-4bd2-87f4-df572831f2e9; Never; [Never,If Target not Detected,Always]

Clone this wiki locally