Icon

kn_​example_​uri_​url_​path_​fun_​with

fun with URI, URL and File Paths

in KNIME there are serveral ways to list files, extract file information use paths and URLs and extract information from them.

For excample you could:
- list all excel files in a folder (/data/)
- list all their sheets
- import every sheet
- construct a file name with file name and sheet name
- export the file/sheet comination as a .table
- also you could try and extract information about your files based on URI paths

fun with URI, URL and File Paths (to be expanded). Key is to split the paths and URLs into their compnents. Also work with absolute and relative paths. collect several Excel files in one KNIME table from a temporary folder and extract them later (problems occur under MacOS as of Sept-2020) /data/ subfolderlist files and give back URLsuse KNIME protocolextract file name andextensioncreate local URI stringlocal_URIAlternative:ultimate Regex URL splitter(.*\/)?(\..*?|.*?)(\.[^.]*?)?(#.*$|\?.*$|$)local_URIURI to portwill reference thelocal fileslocal_URIconvert URIPorts to variablesprepare all filesin local temp folderextractfiles from KNIMEtable to temp foldersURI of thetemporary saved excel filesSTART readexcel filesSTART readexcel sheetsloaddataURI_file_sheetcreate local URI stringURI_file_sheetempty tablewith one linewrite tablewith name of excel fileand sheetURI_file_sheetEND readexcel sheetsEND readexcel filescopy filesto /target_folder/Local fileto URIURI_targetURI_targetall_tables.tableall_tables.tableget Pathextract file name andextension fromPathURI_data2URI_data2copy filesto /data2/from temp folderwhere the extractedfiles from the tablewere storeduse local_URIto get file informationsread file withURI-0path variableuse URIto get file informations GenerateExcel Files List Files URL to File Path String Manipulation Regex Split Column Rename URI to Port String to URI URI Port toVariable Port to File Cells File Cells to Port Port to URI Table Row ToVariable Loop Start Read Excel SheetNames (XLS) Table Row ToVariable Loop Start Excel Reader (XLS) String to URI String Manipulation Table Creator Table Writer Table Rowto Variable Variable Loop End Loop End Copy/Move Files String to URI String Manipulation String to URI Column Filter Table Writer Table Reader Extract URI Info URL to File Path String Manipulation String to URI Copy/Move Files collect meta data File Meta Info Excel Reader (XLS) File Meta Info fun with URI, URL and File Paths (to be expanded). Key is to split the paths and URLs into their compnents. Also work with absolute and relative paths. collect several Excel files in one KNIME table from a temporary folder and extract them later (problems occur under MacOS as of Sept-2020) /data/ subfolderlist files and give back URLsuse KNIME protocolextract file name andextensioncreate local URI stringlocal_URIAlternative:ultimate Regex URL splitter(.*\/)?(\..*?|.*?)(\.[^.]*?)?(#.*$|\?.*$|$)local_URIURI to portwill reference thelocal fileslocal_URIconvert URIPorts to variablesprepare all filesin local temp folderextractfiles from KNIMEtable to temp foldersURI of thetemporary saved excel filesSTART readexcel filesSTART readexcel sheetsloaddataURI_file_sheetcreate local URI stringURI_file_sheetempty tablewith one linewrite tablewith name of excel fileand sheetURI_file_sheetEND readexcel sheetsEND readexcel filescopy filesto /target_folder/Local fileto URIURI_targetURI_targetall_tables.tableall_tables.tableget Pathextract file name andextension fromPathURI_data2URI_data2copy filesto /data2/from temp folderwhere the extractedfiles from the tablewere storeduse local_URIto get file informationsread file withURI-0path variableuse URIto get file informationsGenerateExcel Files List Files URL to File Path String Manipulation Regex Split Column Rename URI to Port String to URI URI Port toVariable Port to File Cells File Cells to Port Port to URI Table Row ToVariable Loop Start Read Excel SheetNames (XLS) Table Row ToVariable Loop Start Excel Reader (XLS) String to URI String Manipulation Table Creator Table Writer Table Rowto Variable Variable Loop End Loop End Copy/Move Files String to URI String Manipulation String to URI Column Filter Table Writer Table Reader Extract URI Info URL to File Path String Manipulation String to URI Copy/Move Files collect meta data File Meta Info Excel Reader (XLS) File Meta Info

Nodes

Extensions

Links