File System: Difference between revisions
Jkuehlthau (talk | contribs) No edit summary |
Jkuehlthau (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
=File System Origin= | |||
The File System Connector reads all files from a folder specified in the Directory field. The Username and Password fields are not used. Filter can be used to filter for certain file names/extensions. To search for all files with an extension of "txt, use the filter "*.txt". To search for all files with "Work" anywhere in the filename, use the filter "*Work*" | The File System Connector reads all files from a folder specified in the Directory field. The Username and Password fields are not used. Filter can be used to filter for certain file names/extensions. To search for all files with an extension of "txt, use the filter "*.txt". To search for all files with "Work" anywhere in the filename, use the filter "*Work*" | ||
Revision as of 17:06, 29 May 2015
File System Origin
The File System Connector reads all files from a folder specified in the Directory field. The Username and Password fields are not used. Filter can be used to filter for certain file names/extensions. To search for all files with an extension of "txt, use the filter "*.txt". To search for all files with "Work" anywhere in the filename, use the filter "*Work*"
The Connector returns standard data in the first 12 fields returned:
- CreationTime
- FullDirectoryName
- DirectoryRelative
- DirectoryName
- Extension
- FullName
- IsReadOnly
- LastAccessTime
- LastWriteTime
- Length
- Name
- LastWriteTime
The Connector returns all information available for the File in json format in the ExtendedProperties field. Rather than add a column for each potential property, we went with a more dynamic method of using one column called “ExtenededProperties” and formatted the data as JSON.
It’s very easy to parse this and then pull out the data you need in Starfish.
First, create a Before Each Row VBScript Operation which loads the chunk of JSON into the parser:
Sub VBScriptProcedure ParseJSON("@@ORG:ExtendedProperties@@") End Sub
Then on your field, pull out the value you want by name..
Function ScriptedField ScriptedField=GetJSON("Authors") End Function
Function ScriptedField ScriptedField=GetJSON("Title") End Function
etc..
If a value doesn’t exist for a particular file, it’ll just return “”.