Icon

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

even more fun with URI, URL and File Paths - work with the new Path variable format to list and move/copy files - using the latest KNIME version 4.6

even more fun with URI, URL and File Paths - work with the new Path variable format to list and move/copy files - using the latest KNIME version 4.6
check out the KNIME File Handling guide (https://docs.knime.com/latest/analytics_platform_file_handling_guide/index.html#introduction)

even more fun with URI, URL and File Paths - work with the new Path variable format to list and move/copy files - using the latest KNIME version 4.6check out the KNIME File Handling guide (https://docs.knime.com/latest/analytics_platform_file_handling_guide/index.html#introduction) 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 locate and create/data/ folderwith absolute paths/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 filesget 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 fromfilesextract string frompath column"Location"extract file name andextension fromURLcreate a columnpath_targetwith same file name but differentlocation /target_folder/path_targetENDURIENDread file withURI-1path variableURI-*convert localfile system foldersto KNIMEpath variables/data2//target_folder//unzipped/Newest modification dateof Excel filesdatestamp_numtimestamp_numconvert thetimestamps to string*_numvar_zip_fileconvert var_zip_fileto KNIMEpath variablesunzipzipped_file_<yyyMMdd>_<hhmmss>.zipto folder/unzipped/var_gzip_fileconvert var_gzip_file andvar_tar_fileto KNIMEpath variables^(var_gzip_file|var_tar_file)$/unzipped_gz/R.utils::gunzipuntar=> not yet working ....var_tar_filegunzipzipped_file_<yyyMMdd>_<hhmmss>.tar.gzto folder/unzipped_gz/STARTSTARTExtract date and time variablescompress .xlsx filesfrom /data/ to azip filezipped_file_<yyyMMdd>_<hhmmss>.zipcompress .xlsx filesfrom /data/ to a.tar.gz filezipped_file_<yyyMMdd>_<hhmmss>.tar.gzcopy filesto /unzipped_gz/copy filesto /target_folder/with individualtarget nameall_tables.tableall_tables.tablecopy filesto /data2/copy all filesto /target_folder/overwrite(in one step) Collect LocalMetadata 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 Extract URI Info URL to File Path collect meta data Excel Reader (XLS)(deprecated) List Files/Folders Files/FoldersMeta Info Path to String URL to File Path String Manipulation String to Path Variable Loop End String to Path Variable Loop End Excel Reader String to Path(Variable) DeleteFiles/Folders DeleteFiles/Folders DeleteFiles/Folders GroupBy Math Formula Math Formula Number To String Table Rowto Variable Java EditVariable (simple) String to Path(Variable) Decompress Files Java EditVariable (simple) String to Path(Variable) DeleteFiles/Folders R Snippet Java EditVariable (simple) Decompress Files Table Row ToVariable Loop Start Table Row ToVariable Loop Start Extract Date&TimeFields CompressFiles/Folder CompressFiles/Folder Transfer Files Transfer Files Table Writer Table Reader Transfer Files Transfer Files(Table) even more fun with URI, URL and File Paths - work with the new Path variable format to list and move/copy files - using the latest KNIME version 4.6check out the KNIME File Handling guide (https://docs.knime.com/latest/analytics_platform_file_handling_guide/index.html#introduction) 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 locate and create/data/ folderwith absolute paths/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 filesget 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 fromfilesextract string frompath column"Location"extract file name andextension fromURLcreate a columnpath_targetwith same file name but differentlocation /target_folder/path_targetENDURIENDread file withURI-1path variableURI-*convert localfile system foldersto KNIMEpath variables/data2//target_folder//unzipped/Newest modification dateof Excel filesdatestamp_numtimestamp_numconvert thetimestamps to string*_numvar_zip_fileconvert var_zip_fileto KNIMEpath variablesunzipzipped_file_<yyyMMdd>_<hhmmss>.zipto folder/unzipped/var_gzip_fileconvert var_gzip_file andvar_tar_fileto KNIMEpath variables^(var_gzip_file|var_tar_file)$/unzipped_gz/R.utils::gunzipuntar=> not yet working ....var_tar_filegunzipzipped_file_<yyyMMdd>_<hhmmss>.tar.gzto folder/unzipped_gz/STARTSTARTExtract date and time variablescompress .xlsx filesfrom /data/ to azip filezipped_file_<yyyMMdd>_<hhmmss>.zipcompress .xlsx filesfrom /data/ to a.tar.gz filezipped_file_<yyyMMdd>_<hhmmss>.tar.gzcopy filesto /unzipped_gz/copy filesto /target_folder/with individualtarget nameall_tables.tableall_tables.tablecopy filesto /data2/copy all filesto /target_folder/overwrite(in one step)Collect LocalMetadata 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 Extract URI Info URL to File Path collect meta data Excel Reader (XLS)(deprecated) List Files/Folders Files/FoldersMeta Info Path to String URL to File Path String Manipulation String to Path Variable Loop End String to Path Variable Loop End Excel Reader String to Path(Variable) DeleteFiles/Folders DeleteFiles/Folders DeleteFiles/Folders GroupBy Math Formula Math Formula Number To String Table Rowto Variable Java EditVariable (simple) String to Path(Variable) Decompress Files Java EditVariable (simple) String to Path(Variable) DeleteFiles/Folders R Snippet Java EditVariable (simple) Decompress Files Table Row ToVariable Loop Start Table Row ToVariable Loop Start Extract Date&TimeFields CompressFiles/Folder CompressFiles/Folder Transfer Files Transfer Files Table Writer Table Reader Transfer Files Transfer Files(Table)

Nodes

Extensions

Links