Skip Headers
Oracle® OLAP DML Reference
10g Release 2 (10.2)

Part Number B14346-03
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

FILTERLINES

The FILTERLINES function applies a filter expression that you create to each line of a multiline text expression.

Return Value

TEXT or NTEXT

This function accepts TEXT values and NTEXT values as arguments. The data type of the return value depends on the data type of the values specified for the arguments:

Syntax

FILTERLINES(source-expression filter-expression)

Arguments

source-expression

A multiline text expression whose lines should be modified according to filter-expression.

filter-expression

An expression to be applied as a filter to each line of source-expression. The terms of the filter expression dictate the processing that FILTERLINES will perform on each line of the source expression.

The filter expression may produce NA, which means that there is no line in the resulting text expression corresponding to the current line of the source expression.

You can use the keyword VALUE in your filter expression to represent the current line of the source expression.

Notes

The Result of FILTERLINES

FILTERLINES returns a text expression composed of the lines that result from the action of the filter expression on each line of the source expression. The filter expression may return multiline text for any or all of the input source lines. None of these lines will be acted on again by the filter expression.

Examples

Example 15-18 Removing Extension From File Names

The following example shows how FILTERLINES could be used on a list of file names to produce a list of those same file names without extensions.

With a multiline text variable named filelist that evaluates to

myfile1.txt
file2.txt
myfile3
file4.txt

the statement

SHOW FILTERLINES(FILELIST -
   IF FINDCHARS(VALUE '.') GT 0 -
      THEN EXTCHARS(VALUE 1 FINDCHARS(VALUE '.') -1) -
      ELSE VALUE)

produces the following output.

myfile1
file2
myfile3
file4