Add a column by retrieving data from a text file

Hi guys, i have this problem: i need to add a column to an existing DataTable, but the problem is that the elements of the cells of the new column, are stored in a text file. My problem is that i have no idea how to implement the method getCell to retrieve the 
I read the example in the documenatation of the site and i did something like this:

private DataColumnSpec createOutputColumnSpec() {
DataColumnSpecCreator colSpecCreator = new DataColumnSpecCreator(
                "Infered", StringCell.TYPE);
DataColumnSpec newColumnSpec = colSpecCreator.createSpec();
return newColumnSpec;
}

Then in the execute method i have something like this:

 // instantiate the cell factory
 CellFactory cellFactory = new InferedCellFactory(createOutputColumnSpec(), File results);
        
// create the column rearranger
ColumnRearranger outputTable = new ColumnRearranger(inData[IN_PORT].getDataTableSpec());
        
// append the new column
outputTable.append(cellFactory);

// create the actual output table
BufferedDataTable bufferedOutput = exec.createColumnRearrangeTable(inData[IN_PORT], outputTable, exec);

// return it
return new BufferedDataTable[]{bufferedOutput};	

In the end, the method getCell in InferedCellFactory.

 public DataCell getCell(DataRow row) {
//i don't know how to retrieve results from a text file based on the passed DataRow
}

Can anyone help me? Thanks in advance!

I guess the path to text file you want to read for each row is stored in one of the columns of the input table? Then you have to get the correct column index/name (usually the user selects it in the dialog), get the path from the cell in each row, read the file, and create a new StringCell with the contents.

First of all thanks for your answer. Unfortunately the process I use is a bit different:
I have:
- an input table with n rows
- only one text file composed by n lines. Each line is associated with the corrisponding row in the datatable (i.e. the 4th line in the text file contains the infered value of the 4th row of the datatable).

My problem is that i don't know how to retrieve the infered value from the (only one) text file that have this structure.

Thanks in advance!

P.s. What if i use a DataContainer to add each result and then merge the input table and the new table? And, if so, do you know how to do that? 

Open a BufferedReader in the execute method, pass it to the ColumnRearranger and then read one line upon each call of getCell. Make sure to close the file afterwards.

Thanks, it works!!