Stan Matthews gets full credit for this and it is exactly what i needed, and tried for quite a while without success.
I am sure i am not the only one needing this so i wanted to post it here for others.
This script retrieves, from a directory, file names, extension, size, path, create date and modify date and puts the data into a table named 'documents'. The Parse_Name field has just the file name and no extension.
The table structure is:
File_Name
File_Path
File_Size
File_Create
File_Modify
also have these calculated fields
File_Ext - calculated with this: FILE.FILENAME_PARSE(FILE_NAME,"E")
Parse_Name - calculated with this: FILE.FILENAME_PARSE(FILE_NAME,"N")
You can replace the * in this line to a specific extension if preferred.
ie: * to jpg for only jpg images.
list = filefind.get_recurse(directory,"*.jpg",
as_is = table.external_record_content_get("documents","alltrim(file_path) +','+ alltrim(file_name) +','+ alltrim(file_Size) +','+ alltrim(file_create) +','+ alltrim(file_modify)")
dim directory as C
directory="C:\Users\Owner\Desktop\Images"+ chr(92)
list = filefind.get_recurse(directory,"*.*",
FILE_FIND_NOT_DIRECTORY,"P,N,L,C,T")
not_found = word_subtract(list,as_is,crlf())
t=table.open("documents",FILE_RW_EXCLUSIVE)
t.populate_from_string("File_Path,File_Name,File_Size,File_Create,File_Modify",crlf(),not_found)
t.close()
I am sure i am not the only one needing this so i wanted to post it here for others.
This script retrieves, from a directory, file names, extension, size, path, create date and modify date and puts the data into a table named 'documents'. The Parse_Name field has just the file name and no extension.
The table structure is:
File_Name
File_Path
File_Size
File_Create
File_Modify
also have these calculated fields
File_Ext - calculated with this: FILE.FILENAME_PARSE(FILE_NAME,"E")
Parse_Name - calculated with this: FILE.FILENAME_PARSE(FILE_NAME,"N")
You can replace the * in this line to a specific extension if preferred.
ie: * to jpg for only jpg images.
list = filefind.get_recurse(directory,"*.jpg",
as_is = table.external_record_content_get("documents","alltrim(file_path) +','+ alltrim(file_name) +','+ alltrim(file_Size) +','+ alltrim(file_create) +','+ alltrim(file_modify)")
dim directory as C
directory="C:\Users\Owner\Desktop\Images"+ chr(92)
list = filefind.get_recurse(directory,"*.*",
FILE_FIND_NOT_DIRECTORY,"P,N,L,C,T")
not_found = word_subtract(list,as_is,crlf())
t=table.open("documents",FILE_RW_EXCLUSIVE)
t.populate_from_string("File_Path,File_Name,File_Size,File_Create,File_Modify",crlf(),not_found)
t.close()
Comment