Row filter: rows after or below a certain tag

I have a file, in which several tables are included. Each table has a certain start and end tag string. The file is read in as such. Thus, each tag is in a single row, on column Thus, I want to extract/ filter the rows below start tag and before end tag. E.g.

[rows 0 to 200]

# Start 2#

1 2

2 3

# End 2#

[rows 205 til end]

 

Should be filtered out to:

1 2

2 3

 

How can I do that?

Hi,

I would add an explicit ROWINDEX with the Math formula or Java Snippet node, filter to get only the tagged rows and cast the two resulting row indexes into flow variables. These vars you can pipe into the Row Filter node for "FROM" and "TO", and you should be all set.

Cheers
E

How do you cast the filtered rows into flow variables? And wehre are the FROM TO fields?

(working with knime 2.12.2)

Hi,

Casting to varibles is best done by the chain of "transpose --> rename colums --> table column to variable". I would call the low value column "FROM" and the high value "TO", which determines the name of the flow variables downstream. Then just connect the final flow variable post to the row filter node, set the Row Filter node to "Include rows by number" and configure the variable-driven range in the "Flow Variables" tab of the node.

This should do the trick - sorry to keep this textual, but I have severe upload constraints.

Cheers
E

By the way, the above will give you:

# Start 2#

1 2

2 3

# End 2#

If you want just the rows between the tags, you'll have to use "Java Edit Variable" with "return $FROM$ + 1;" and "return $TO$ -1;" respectively.

:-)

Cheers
E