Make a file reader become a string expression for any propous

Hi folks,

Some time ago, I asked for a way that I can use a SQL/HTML etc to become a entire script for some propus as make a string that represent a SQL request or a HTML to be loaded and create a final file.

Well, I made it with some simple ideas… I used a file reader and groupt nodes to make a single row!

For this context, here the flow:

image

From “File Reader”, I select an html file, set for delimiter as ‘pipe’, as for the other setup options (quotes and escape).

I select short data rows because can represent some possible sittuations that can make some mistakes.

As the print below, You can see the result as preview.

From ‘Groupby’, I just make a concatened with the expression ‘\n\r’ as a term to make it as “regular expression” for newline and return carrier.

At the end for this process, I just rename the column with a new name for my propous.

Result: A single cell with all lines for the script!

I hope that trick can help you!

Thanks,

Denis Iongbloed

3 Likes

Hi @denisfi,

Thanks for sharing this with the community! Your approach to handling SQL/HTML scripts with the file reader and group nodes is super helpful.

Best,
Keerthan

Thanks, it was a step that break me sometime to use scripts inside knime… now I can have some files outside made by programmers with variables and manipulate them with string manipulation too.

Seeya!

Denis

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.