file reader starting point in different rows



I´m new here, but I used the informations of this forum very often to learn Knime. Great Information base!

My actual problem is within a loop if csv-files. Unfortunately the header of the files hasn´t always the same number of rows, so I can´t use the fnction to skip a fix number of rows. I have a character two lines above the header row to identify the starting point.


Is there any solution to use this information to "standardize" the csv´s? I even thought about a way to delete rows until this point to get a clean database for the loop.

Reading all the rows, and then using a Row Filter node to remove those that match your header pattern might work.



Thanks for the reply.


Unfortunately not all Rows I want to delete have this pattern. It´s just one above the needed data.


I´m searching for a node to remove rows until the pattern is found.

OK, try this in a Java snippe row filter node, put the following code in the top box ('Global Variable Declaration' - stuff in here is persisted between rows in the incoming table):

boolean commentFound=false;

And then in the 'Method Body' part put:

//Replace with your pattern
String pattern="#";
	//We've found the pattern,
	//But still dont want this/ese line(s)
	return false;

	//We've not yet found the pattern
	return false;

//To get here, we must have found the pattern
//And not be starting with the pattern;
return true;

 * NB For simplicity, the above from
 * 'if(!commentFound)... could be replaced
 * with return !commentFound;

This should give you what you want. You will need to replace


with the relevant column (highlight this text, and then double click on the column name you want in 'Column List' part of the configuration dialog), and pattern with whatever comment pattern your line starts with.  I tried this on the following dummy input:

Column 1
Some stuff not needed
more not needed
#Comment before data
My first data line
My next data line

And got the following out:

					<td>Column 1</td>
					<td>Some stuff not needed</td>
					<td>more not needed</td>


		<p>Does that help do what you want?</p>




Thanks a lot. Works for me, even If I´m absolute stupid regarding Java. Great support!

No problem! When I first started using KNIME I knew no Java either!