How to add new rows according column values

Hello,

I am struggling with adding new rows as follows, the first table is what I have at present, and the second table is what I want to get, so is anybody know how to achieve this goal? Thank you very much in advance!

Table1  
URL Number
URL1 4
URL2 5
URL3 2

 

Table2  
URL Number
URL1 1
URL1 2
URL1 3
URL1 4
URL2 1
URL2 2
URL2 3
URL2 4
URL2 5
URL3 1
URL3 2

Dear Tan,

 

this is a little bit tricky. What I would do is the following.

First Chunk loop Start (one row per chunk)

one row to many (will make e.g. 4  rows for URL1)

Than the Counter node 

Finnish with a Loop End node.

 

Best regards, Iris 

thank you very much for your great input!

Hi guys,

My main aim is to get texts from URL and analyse these texts. I have successfully built the workflow and it works well with xpath, however, I am struggling with the UTF-8 encoding when using htmlparser since the Chinese characters in the website page (url: http://101.227.16.139/ire/2016/11/1/IADT_CPI_AD_46.html) have been parsed into gibberish code as following:

<?xml version='1.0' encoding='UTF-8'?>
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    </head>
    <body>IADT_CPI_INIT:2<br>
        </br>IADT_CPI_Media:爱奇艺|爱奇艺 APP-AndroidPPS-巨星电影<br>
        </br>
        <br>
        </br>
        <br>
        </br>
        <br>
        </br>IADT_CPI_Update:2016-11-01 00:02:57<br>
        </br>
    </body>
</html>

 

I have checked with the URL technical team and they confirmed that the URL encode is UTF-8, however, I still got the above mess with Chinese. How can I solve this issue with Knime? Is there some node to change these xml to normal display in Chinese? THank you very much if you can help to to solve this!

 

Best wishes!

have a look at the attached worfklow. 

I wrote the output to a csv file, and then read it in again with a file reader. the file reader allows you to specify the character encoding, and it brings  back the Chinese characters.

I've also inlcuded a java snippet solution to the initial question, using lists in java and ungroup to exapnd it out.

David

 

 

1 Like

Thank you !!! help me a lot!