How can I extract all the extensions in a folder by the number of each one?
For example, several Excel files, several PDFs, several texts, etc.
My intended output:
csv : 114
pdf: 205
text: 40
movie: 16
and …
How can I extract all the extensions in a folder by the number of each one?
For example, several Excel files, several PDFs, several texts, etc.
My intended output:
csv : 114
pdf: 205
text: 40
movie: 16
and …
Welcome to KNIME Forum !
Start with the List Files/Folders node and connect it to a String Manipulation node.
Configure the String Manipulation node as follows;
substr($Path$, lastIndexOfChar($Path$,'.' )+1)
gr. Hans
… and for the counts, you can then use a GroupBy node with a count
aggregation:
-Philipp
I want to show how many extensions are in the folder
Like the bottom line
csv : 114
pdf: 205
text: 40
movie: 16
and …
Hello @behghorchiknime and welcome to the KNIME community
Aiming to make your life easier, you can concatenate the following nodes:
Start with your ‘List Files/Folders’ node returning a column in path format.
‘Path to String’ node:
Path to String – KNIME Community Hub
‘URL to File Path’ node, this node will return a file extension column ready to use:
URL to File Path – KNIME Community Hub
And last but not least, as @qqilihq suggested: group by ‘file extension’ column
BR
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.