Icon

Challenge 14 - Removing Noise from Data - Solution

Removing Noise from Data

You are working with audio recognition data tables such that each table’s initial and final rows contain zeroes. These beginning and ending zeroes are irrelevant noise that must be removed. Here is an example of such a data table:

0
0
8
0
7
1
0

Your goal is to only remove these unnecessary starting and trailing zeroes. You must keep the zeroes in the middle of the data, which do not constitute noise. As well, the position of the starting and trailing zeroes differs per data table, so a good solution probably requires flow variables for flexibility (although there may be other solutions which do not involve flow variables).

You are working with audio recognition data tables such that each table’s initial and final rows contain zeroes. These beginning and ending zeroes are irrelevant noise that must be removed. Here is an example of such a data table:0080710Your goal is to only remove these unnecessary starting and trailing zeroes. You must keep the zeroes in the middle of the data, which do not constitute noise. As well, the position of the starting and trailing zeroes differs per data table, so a good solution probably requires flow variables for flexibility (although there may be other solutions which do not involve flow variables).
Original forum thread with other possible solutions: https://forum.knime.com/t/remove-zero-value-for-head-and-tail/39033
string format to integer format
String to Number
remove all zerosfrom the data
Row Filter
remove trailing zeros
Row Filter
first RowID numbercorresponding to anon-zero entry
Table Row to Variable
last RowID numbercorresponding to anon-zero entry
Table Row to Variable
reverse rowids
Sorter
example data
CSV Reader
remove starting zeroes
Row Filter
get RowID numbers
String Manipulation
remove temporaryrow_number column
Column Filter

Nodes

Extensions

Links