extract()

Extracts the text value from a rectangular region. All coordinates are expressed as characters.

The extract method always returns a String data type.

Related Object: Data.

extract(left, right, verticalOffset, regionHeight, separator)

Extracts a value from a position in a text file.

left

Number that represents the distance from the left edge of the page to the left edge of the rectangular region.

right

Number that represents the distance from the left edge of the page to the right edge of the rectangular region.

verticalOffset

Number that represents the distance from the current vertical position.

regionHeight

Number that represents the total height of the region.

separator

String inserted between all lines returned from the region. An empty string can be specified.

Examples

Example 1:

In this example you have the script command data.extract(1,22,8,1,"<br />");. It means that the left position of the extracted information is located at 1, the right position at 22, the offset position is 8 (since the line number is 9) and the regionHeight is 1 (only 1 line selected). Finally, the "<br/>" string is used for concatenation.

Example 2:

In this example you have the script command data.extract(1,22,9,6,"<br />");. It means that the left position of the extracted information is located at 1, the right position at 22, the offset position is 9 (since the first line number is 10) and the regionHeight is 6 (6 lines are selected). Finally, the "<br/>" string is used for concatenation.

extract(xPath)

Extracts the text value of the specified node.

xPath

String that can be relative to the current location or absolute from the start of the record.

Example

In this example you have the script command data.extract('./CUSTOMER/FirstName');. It means that the extraction is made on the FirstName node under Customer.

extract(columnName, rowOffset)

Extracts the text value for the specified fieldName.

fieldName

String that represents the column name.

rowOffset

Number that represents the row index relative to the current position. To extract the current row, specify 0 as the rowOffset.

Example

In this example you have the script command data.extract('ID',0);. It means that the extraction is made on the ID field in column 0 (the first from the left).

extract(left, right, verticalOffset, lineHeight, separator)

Extracts the text value from a rectangular region. All coordinates are expressed in millimeters.

left

Double that represents the distance from the left edge of the page to the left edge of the rectangular region.

right

Double that represents the distance from the left edge of the page to the right edge of the rectangular region.

verticalOffset

Double that represents the distance from the current vertical position.

lineHeight

Double that represents the total height of the region.

separator

String inserted between all lines returned from the region. An empty string can be specified.

Example

In this example you have the script command data.extract(4.572,51.815998,37.761333,3.7253342,"<br />");. It means that the left position of the extracted information is located at 4.572mm, the right position at 51.815998mm, the vertical offset position is 37.761333mm and the lineHeight is 3.7253342mm. Finally, the "<br/>" string is used for concatenation.

 
  • Last Topic Update: 24/01/2017 09:32
  • Last Published: 7/6/2017 : 9:48 AM