Icon

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

more fun with URI, URL and File Paths - work with the new Path variable format to list and move/copy files

use the (new) Path variable format to adress (local) files and handle them. The key is to get a local path and work with taht and if you try to handle files convert a string to a Path file and (mostly) use custom strings. Some nodes are not fully ready to work consitantly with the Path variables, some would not work with the KNIME protocol.


more fun with URI, URL and File Paths - work with the new Path variable format to list and move/copy files collect several Excel files in one KNIME table from a temporary folder and extract them later (problems occur under MacOS as of Dec-2020) This is not particulary elegant but it works to move/copy files to a destination ZIP and UNZIP files from a folder using a date and time stamp /data/ subfoldercreate 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 filesall_tables.tableall_tables.tableget Pathextract file name andextension fromPathkey to local fileoperations to get a basic pathand combine that with (new)path variablesread file withURI-0path variablelist XLSX files and give back URLsuse KNIME protocolextract meta informations fromfilesconvert localfile system foldersto KNIMEpath variablescopy filesto /target_folder/extract string frompath column"Location"extract file name andextension fromURLcreate a columnpath_targetwith same file name but differentlocation /target_folder/path_targetENDURIcopy filesto /target_folder/ENDread file withURI-0path variableconvert localfile system foldersto KNIMEpath variables/data2//target_folder/compress .xlsx filesfrom /data/ to azip filezipped_file_<yyyMMdd>_<hhmmss>.zip/unzipped/Newest modification dateof Excel filesExtract date and time variablesdatestamp_numtimestamp_numconvert thetimestamps to string*_numvar_zip_fileconvert var_zip_fileto KNIMEpath variablesunzipzipped_file_<yyyMMdd>_<hhmmss>.zipto folder/unzipped/compress .xlsx filesfrom /data/ to a.tar.gz filezipped_file_<yyyMMdd>_<hhmmss>.zipvar_gzip_fileconvert var_gzip_file andvar_tar_fileto KNIMEpath variables^(var_gzip_file|var_tar_file)$/unzipped_gz/copy filesto /unzipped_gz/R.utils::gunzipuntarvar_tar_filegunzipzipped_file_<yyyMMdd>_<hhmmss>.tar.gzto folder/unzipped/STARTSTART GenerateExcel Files 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 Writer Table Reader Extract URI Info URL to File Path collect meta data Excel Reader (XLS)(deprecated) List Files/Folders Files/FoldersMeta Info String to Path(Variable) Transfer Files Path to String URL to File Path String Manipulation String to Path Variable Loop End String to Path Transfer Files Variable Loop End Excel Reader String to Path(Variable) DeleteFiles/Folders DeleteFiles/Folders CompressFiles/Folder DeleteFiles/Folders GroupBy Extract Date&TimeFields Math Formula Math Formula Number To String Table Rowto Variable Java EditVariable (simple) String to Path(Variable) Decompress Files CompressFiles/Folder Java EditVariable (simple) String to Path(Variable) DeleteFiles/Folders Transfer Files R Snippet Java EditVariable (simple) Decompress Files Table Row ToVariable Loop Start Table Row ToVariable Loop Start more fun with URI, URL and File Paths - work with the new Path variable format to list and move/copy files collect several Excel files in one KNIME table from a temporary folder and extract them later (problems occur under MacOS as of Dec-2020) This is not particulary elegant but it works to move/copy files to a destination ZIP and UNZIP files from a folder using a date and time stamp /data/ subfoldercreate 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 filesall_tables.tableall_tables.tableget Pathextract file name andextension fromPathkey to local fileoperations to get a basic pathand combine that with (new)path variablesread file withURI-0path variablelist XLSX files and give back URLsuse KNIME protocolextract meta informations fromfilesconvert localfile system foldersto KNIMEpath variablescopy filesto /target_folder/extract string frompath column"Location"extract file name andextension fromURLcreate a columnpath_targetwith same file name but differentlocation /target_folder/path_targetENDURIcopy filesto /target_folder/ENDread file withURI-0path variableconvert localfile system foldersto KNIMEpath variables/data2//target_folder/compress .xlsx filesfrom /data/ to azip filezipped_file_<yyyMMdd>_<hhmmss>.zip/unzipped/Newest modification dateof Excel filesExtract date and time variablesdatestamp_numtimestamp_numconvert thetimestamps to string*_numvar_zip_fileconvert var_zip_fileto KNIMEpath variablesunzipzipped_file_<yyyMMdd>_<hhmmss>.zipto folder/unzipped/compress .xlsx filesfrom /data/ to a.tar.gz filezipped_file_<yyyMMdd>_<hhmmss>.zipvar_gzip_fileconvert var_gzip_file andvar_tar_fileto KNIMEpath variables^(var_gzip_file|var_tar_file)$/unzipped_gz/copy filesto /unzipped_gz/R.utils::gunzipuntarvar_tar_filegunzipzipped_file_<yyyMMdd>_<hhmmss>.tar.gzto folder/unzipped/STARTSTARTGenerateExcel Files 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 Writer Table Reader Extract URI Info URL to File Path collect meta data Excel Reader (XLS)(deprecated) List Files/Folders Files/FoldersMeta Info String to Path(Variable) Transfer Files Path to String URL to File Path String Manipulation String to Path Variable Loop End String to Path Transfer Files Variable Loop End Excel Reader String to Path(Variable) DeleteFiles/Folders DeleteFiles/Folders CompressFiles/Folder DeleteFiles/Folders GroupBy Extract Date&TimeFields Math Formula Math Formula Number To String Table Rowto Variable Java EditVariable (simple) String to Path(Variable) Decompress Files CompressFiles/Folder Java EditVariable (simple) String to Path(Variable) DeleteFiles/Folders Transfer Files R Snippet Java EditVariable (simple) Decompress Files Table Row ToVariable Loop Start Table Row ToVariable Loop Start

Nodes

Extensions

Links