A File Collector describes the structure, content, naming patterns and location of files of data to be imported into PhixFlow.
Note that File Collectors can also be used to process files that reside inside compressed file archives such as zip files. Please see the section below on Compressed Files for further information.
Info |
---|
This page describes, in detail, all configuration options for file collectors. But if you are setting up a file collector to load email messages and/ or attached files, a good starting place is the article How To: Read data from an email account, which covers a number of common examples. |
Form: File Collector Details
The following fields are configured on the Details tab:
...
- Specified Directory: This option will cause the file collector to use the Import File Location (specified in System Configuration on the System Directories tab) as the root input directory when looking for files to load.
- Managed File: This option will cause the file collector to use the File Upload Directory (specified in System Configuration on the System Directories tab) as the root input directory when looking for files to load.
...
- Comma Separated Values: fields are delimited by a comma, (or other character).
- Fixed Length Records: fields have a fixed column width.
- Binary File: Data is extracted from the file using a Binary File Grammar (in XML) specified in the File Format Description tab.
- File Details Only: Only attribute details about the file itself will be available.
- Excel Spreadsheet: Data is extracted from the an excel spreadsheet supporting a .xls or .xlsx extension.
.xlsx type excel files containing in excess of 10,000 rows are not supported by PhixFlow and should not be imported using a File Collector.
- XML File: Data is extracted from an XML file
- HTML File: Data is extracted from an HTML file
...
File Location Strategy
...
This input database collector or stream must be attached to the file collector by a lookup pipe with no index set. The attribute of the input stream or collector which contains the file path names is specified in the field: File Name Attribute. The value entered into this field should be plain text, e.g. myFilePaths but not quoted "myFilePaths".
Each file path name is interpreted as a pathname relative to the Import Directory. A path name may be a simple file name, or it may have multiple levels of directory, including compressed files (which will be interpreted as directories). The directory separator must be '/' (forward-slash), and not '\' (back-slash), even on a Windows platform. There should be no leading '/'.
...
Read Names: read in file locations from a collector or stream. This input collector or stream must be attached to the file collector by a pipe. The attribute of the input stream or collector which contains the file locations is specified in the field: File Name Attribute.
...
Text Expression
(special case: only string literals allowed, no PhixFlow variables)
...
This field is only available if the Source Type field is set to Managed File. When files are uploaded by PhixFlow they are placed into a directory whose full path is a combination of the root File Upload Directory (specified in System Configuration on the System Directories tab), the tag value specified here and the Input Directory specified below (hard coded to 'in' for Managed files).
For example, if the System Configuration File Upload Directory is set to C:\ManagedFiles and Tag is set to CVFiles then the File Collector will look within C:\ManagedFiles\CVFiles\in for files to process.
If you are creating a file collector to load email messages and/ or attached files, you can specify a tag here if one has been provided in the subject line of the incoming emails. See How To: Read data from an email account for further details.
...
Ignore Base Directory
...
Source Type = Specified Directory
If the Source Type is Specified Directory, files will be ready from the directory specified in Input Directory Expression.
Unless the flag Ignore Base Directory is ticked, the path specified in this field will be added to the default input directory root - this is specified in the System Configuration File Upload Location. If the flag Ignore Base Directory is ticked, the full path for the input directory must be specified.
In fact, this field is an expression. This must evaluate to a plain text string. In the simple case, this will be text surrounded by quotes, e.g.
Code Block |
---|
"C:/data/address/input/accountValues" |
You can include PhixFlow variables in this expression, e.g.:
Code Block |
---|
"C:/data/address/input/" + _inputMultiplier |
If you need to include wildcards or some other variable element in the resulting path, you must use the Directory Pattern Expression.
If File Location Strategy = All Files in Folder PhixFlow will look in this directory to find files matching the pattern specified in File Pattern Expression.
If File Location Strategy = Read Names this is added to the start of the file location read from the file name attribute.
Source Type = Managed File
If the Source Type is Managed file, this will contain a non editable value of "in"
This will be appended to the combined path of System Configuration File Upload Directory and Tag to give the input directory that files will be read from.
...
This field is used to identify valid sub-directories of the input directory.
If a Directory Pattern Expression is provided then PhixFlow will not only check the Input Directory for files but will also check all sub-directories of the Input Directory. Each file found will then not only have its name checked against the File Pattern Expression but will also have the relative path from the Input Directory to the file (referred to as the sub-directory path) checked against the Directory Pattern Expression.
For example, suppose the Input Directory has the sub-directories: 'region1/teamA'; 'region1/teamB'; 'region2/teamA'. If you want all the files across all regions for teamA, but not teamB, then you could use the following Directory Pattern Expression to pick out just the files for teamA:
".*/teamA/"
Alternatively, if you wanted all the files for all teams in region 1 only, you could use the following Directory Pattern Expression:
"region1/.*"
Regular expression rules are used to perform this match rather than the sort of pattern matching rules you might be used to when listing files. For example:
- To match any string of characters, you must use ".*" and not "*"
- To match a "." you must use "\\." and not "." (which means any character)
- You must use forward slashes "/" instead of backslashes "\" for directory separators
A number of internal variables are available in these expressions:
- _fromDate: the start date of the period of the stream being processed.
- _toDate: the end date of the period of the the stream being processed.
Note that there are also a number of predefined compressed file expressions that will always be checked to determine if a file within a valid sub directory is actually a compressed file. If so then this file will assumed to be a valid compressed file and hence will be recursed into as if it was a standard matching directory. Please see Compressed Files for a list of valid compressed file expressions.
...
This field can be used to exclude certain sub-directories found by the Directory Pattern Expression.
For example, suppose the Input Directory has the sub-directories: 'region1/teamA'; 'region1/teamB'; 'region2/teamA'. If you want all the files across all regions for teamA, but not teamB, then you could use the following Directory Pattern Expression to find all files:
".*"
combined with the following Exclude Dir. Pattern Expr to exclude those for teamB:
".*/teamB/"
Regular expression rules are used to perform this match rather than the sort of pattern matching rules you might be used to when listing files. For example:
- To match any string of characters, you must use ".*" and not "*"
- To match a "." you must use "\\." and not "." (which means any character)
- You must use forward slashes "/" instead of backslashes "\" for directory separators
A number of internal variables are available in these expressions:
- _fromDate: the start date of the period of the stream being processed.
- _toDate: the end date of the period of the the stream being processed.
...
- _fromDate: the start date of the period of the stream being processed.
- _toDate: the end date of the period of the the stream being processed.
- %SEQ%: the current sequence number.
Examples:
"inputRecords.txt"
will read files called "inputRecords.txt" from the input directories.
".*"
will read all files in the input directories.
".*\\.txt"
will read all files in the input directories with the extension ".txt"
"teamA.*"
will read all files in the input directories starting with "teamA."
"record_" + toString(now(),"yyyy-MM-dd") + "\\.txt"
will read files in the input directories with the format "record_yyyy-MM-dd.txt", where yyyy-MM-dd is the current date. E.g. "record_2013-03-26.txt".
"("+listToString(_context.f,"|")+")"
will read files with name contained in the list of files uploaded by the Stream Action which caused the File Collector to run, but only if a Context Value called 'f' is set in the Action and its value expression is '_files'
...
The next sequence number expected to be found within the name of the file being imported.
This field is only available if File Location Strategy = All Files in Folder.
...
- Error: unreadable directories will be reported, and if any are found, the file search will fail.
- Warning: unreadable directories will be reported, but the file search will continue unaffected.
- Ignore: unreadable directories will be silently ignored
...
This field should be populated according to valid XPath syntax. Please see XPath Examples for how to use XPath expressions and how the returned data can be used and evaluated in the corresponding stream attribute expressions.
...
Text/
Dropdown
...
Text/
Dropdown
...
Text/
Dropdown
...
If this flag is set then PhixFlow will not throw an error if the record being read contains more columns than expected. If this flag is not set then an error will be reported if there are too many columns.
...
If this flag is set then PhixFlow will not throw an error if the record being read contains fewer columns than expected. If this flag is not set then an error will be reported if there are too few columns.
...
This field is only available if File Type = Excel Spreadsheet.
This field is an expression that must evaluate to a list of ranges with the format "WorksheetName!TopLeftCell:BottomRightCell"
If this field is left blank, PhixFlow will read the first worksheet it finds in the excel file (even if this is a hidden sheet) with a range covering the whole sheet.
E.g. if just a single range is needed: "DailyCallsSheet!A1:G100"
E.g. if a list of ranges is required: ["DailyCallsSheet!A1:G100", "A1:B20", "Calls!A1:C100"]
Remember that in all cases PhixFlow will only read the columns that have been defined in the File Columns tab.
Because this field is an expression, the resulting list can be generated with any valid PhixFlow expression. You can also use the internal variable _worksheets which gives you the list of worksheets that PhixFlow found in the file. See the example below for how you might use this.
Examples
- All rows and columns in the default 1st worksheet:- leave this field empty as this is the default behaviour
- Specified columns only on the default 1st worksheet:- "A:C"
- Specified cell range only on the default 1st worksheet:- "B1:G10"
- Specified cell range on a specified worksheet:- "DailyCallsSheet!A2:F20"
- List of specified cell ranges on multiple worksheets:- ["DailyCallsSheet!A2:F20", "Calls!A1:C400", "Accounts!A5:F50"]
- Examine the list of worksheets that have been found and specify ranges for only certain sheets, if they exist:
do ( $rangeList = [],
forEach($sheet, _worksheets,
if ( listContains(["sheetA", "sheetB"], $sheet),
addElement($rangeList, $sheet + "!A1:B10")
)
),
$rangeList
)
This expression will evaluate to the list of a maximum of two ranges, if both worksheets sheetA and sheetB exist - in this case, this is equivalent to ["sheetA!A1:B10", "sheetB!A1:B10"]. Crucially, if a sheet is not found, the range will not be included. This is important for error handling. If you specify a range that is not in the excel file PhixFlow will error. So if you are not sure that a worksheet will always be included, write an expression like this to check, and only specify the range when the sheet is found.
Related internal variables
See notes for the internal variables _worksheet and _range below. These can be used in stream attribute expressions to record the source worksheet and range for data you have loaded into PhixFlow.
Constraints
Note that if a worksheet is specified, then the full cell range must also be specified. Hence it is not possible to select a 'worksheet only' or 'columns only for a specified worksheet'. e.g DailyCallsSheet or DailyCallsSheet!A:C are not supported.
...
This checkbox is only available if File Type = Excel Spreadsheet.
If you are reading a spreadsheet which is password protected, enter the password here so that the file can be unlocked.
...
This checkbox is only available if File Type = Excel Spreadsheet.
...
The following fields are configured through the File Format Description tab on the form: Note : this tab is only available for Binary File Collectors.
...
Expression:
list of strings
...
A list of target node names - that is, the names of nodes that will generate an output record.
Example of a single target:
"DATA_RECORD"
Example of a list of targets:
["DATA_RECORD1","DATA_RECORD2","DATA_RECORD3"]
...
The following fields are configured through separate tabs on the form:
...
Forms: File Columns
The data columns present in the import file are defined here.
Form: File Column Details
...
- String
- Integer
- Float
- Date - please see valid Date formats
- Datetime - please see valid Datetime formats
- TrueFalse - please see valid TrueFalse values
...
File Collector Properties
Basic Settings
Field | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Name | Enter a name for this file collector. | ||||||||||||||||||||||||
Auto Configuration | This check box is available for a new file collector that has not been configured. It is ticked by default.
| ||||||||||||||||||||||||
Enabled |
| ||||||||||||||||||||||||
Source Type | Select whether or not the file is already on the PhixFlow server. Specified Directory Use for files that are already stored on the PhixFlow server. By default, PhixFlow assumes files are in the System Configuration → System Directories → Import File Location, or a subdirectory of it. You must also specify the relative path to the file(s) in the Input Directory Expression. If your file is not in the Import File Location, select Specified directory and tick Ignore base directory. In this case you must also specify the full path to the file(s) in the Input Directory Expression. See also Input Directory Expression and Ignore base directory, below. Managed File Use for files that you have on your local machine or the network. For a managed file, you must load the file before running the file collector.
If you have selected Auto Configuration, PhixFlow automatically starts the process for loading a managed file; see Easy Loading for Excel Spreadsheets, below. | ||||||||||||||||||||||||
Number of Header Lines | Enter the number of lines in the header of the file. These are ignored when reading the file. (This option is not available for Binary File, XML and HTML file types). | ||||||||||||||||||||||||
File Type | Can have values:
For information about the PhixFlow internal variables you can use to specify the attributes you want, see File Collector Attributes, below. | ||||||||||||||||||||||||
Next Sequence | Available when File Location Strategy is All Files in Folder. Enter the next sequence number expected to be found within the name of the file being imported. | ||||||||||||||||||||||||
Allow Non-Scheduled Collection |
| ||||||||||||||||||||||||
FTP Site | Specify the FTP Site on which the import file is stored. If no site is specified then the file is assumed to be on the local machine. If a site is specified then all directory paths specified on this form should be the full path to the file since the base directory specified in system configuration is ignored (since the base directory is specific to the local machine). | ||||||||||||||||||||||||
File Location Strategy | Select one of:
This input database collector or stream must be attached to the file collector by a lookup pipe with no index set. The attribute of the input stream or collector which contains the file path names is specified in the field: File Name Attribute. The value entered into this field should be plain text, e.g. myFilePaths but not quoted "myFilePaths". Each file path name is interpreted as a pathname relative to the Import Directory. A path name may be a simple file name, or it may have multiple levels of directory. Compressed files are interpreted as directories. On Linux and Windows platforms, the directory separator must be forward-slash
Read in file locations from a collector or stream. This input collector or stream must be attached to the file collector by a pipe. The attribute of the input stream or collector which contains the file locations is specified in the field: File Name Attribute.
| ||||||||||||||||||||||||
Tag
| Available when Source Type field is Managed File. Specify a sub-directory of System Configuration → System Directories → File Upload Directory using string literals only. Do not use PhixFlow variables. PhixFlow loads files into a directory whose full path is a combination of:
For the example paths above, the file collector looks in the directory If you are creating a file collector to load email messages and/or attached files, you can specify a tag here if one has been provided in the subject line of the incoming emails. See Reading Data From an Email Account for further details. | ||||||||||||||||||||||||
Ignore Base Directory | Available when Source Type is Specified Directory. The base directory is set in System Configuration → System Directories → Import File Location.
| ||||||||||||||||||||||||
Input Directory Expression
| Specify the location of the files you want to load. When Source Type is Managed File This field contains a read-only value of When Source Type is Specified Directory Specify a path:
If File Location Strategy is:
See also System Configuration for File Upload Directory and Import File Location. | ||||||||||||||||||||||||
Directory Pattern Expression | Enter a regular expression to specify one or more relative paths from the Input Directory to its sub-directories. PhixFlow looks in the input directory and its sub-directories for files whose names match the File Pattern Expression. PhixFlow can recognise some compressed file types; see Handling Compressed Files, below. PhixFlow treats these compressed files as a matching sub-directory. Internal VariablesYou can use the following PhixFlow internal variables in this expression:
| ||||||||||||||||||||||||
Exclude Dir. Pattern Expr. | If the Directory Pattern Expression includes some sub-directories that you do not want to search, enter a regular expression that will exclude those sub-directories. Internal VariablesYou can use the following PhixFlow internal variables in this expression:
| ||||||||||||||||||||||||
File Pattern Expression | Available when File Location Strategy is All Files in Folder. Enter a regular expression that will match one or more files in the Input Directory, in order to generate a list of files to load. PhixFlow uses the File Pattern Expression combined with the fields that specify the directories in which to look. This means PhixFlow:
If the specified directories contain no files that match the regular expression, the file collector will not load any files. Internal VariablesYou can use the following PhixFlow internal variables in this expression:
| ||||||||||||||||||||||||
Archive Directory Expression | Optionally, enter an expression for a directory path. The expression must resolve to a Regular Expression.
The Archive Directory Expression is the location to which all files processed by the file collector will be written. The Error Directory Expression is the location to which any files that cause an error during processing will be written. | ||||||||||||||||||||||||
Error Directory Expression | |||||||||||||||||||||||||
Local Archive Directory | Available when FTP Site is specified. Specify whether the archive directory is on the PhixFlow server (local) or on the original server.
| ||||||||||||||||||||||||
Local Error Directory | Available when FTP Site is specified. Specify whether the error directory is on the PhixFlow server (local) or on the original server. |
Advanced
Field | Description | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Maximum Files | Enter the maximum number of files that PhixFlow will process when the file collector runs. | ||||||||||||||||||||||
Minimum Files | Enter the minimum number of files that PhixFlow expects to find when the file collector runs. If fewer files are found then this is treated as an error. | ||||||||||||||||||||||
Max Records Per File | Enter the maximum number of records that PhixFlow will read from each file. | ||||||||||||||||||||||
Errors Before Rollback |
| ||||||||||||||||||||||
Parallel Readers | Enter the number of files to process in parallel. If blank, this defaults to 1. If the file collector is configured to read files in sequence, this field is ignored and a single file reader is used. | ||||||||||||||||||||||
Unreadable Directories | Select what PhixFlow will do if there are unreadable directories when it is searching a directory hierarchy for files to import.
| ||||||||||||||||||||||
XPath Expression | Available when File Type is XML File or HTML File. Enter valid XPath syntax. For information about how to use XPath expressions and how to use the returned data in the corresponding stream attribute expressions, see XPath Examples. | ||||||||||||||||||||||
Character Set |
| ||||||||||||||||||||||
Column Separator |
| ||||||||||||||||||||||
Separator Character |
| ||||||||||||||||||||||
Quote Style |
| ||||||||||||||||||||||
Quote Character |
| ||||||||||||||||||||||
Ignore Extra Columns |
| ||||||||||||||||||||||
Ignore Missing Columns |
| ||||||||||||||||||||||
Import Rows Matching | Enter an expression that PhixFlow compares to each line in the file against the expression. Only lines that match are imported. | ||||||||||||||||||||||
Replace Text Matching | In each imported line, find all occurrences of the expression that you enter in Replace Text Matching and replace it with the expression that you enter in With. | ||||||||||||||||||||||
With | |||||||||||||||||||||||
Excel Data Range Expression |
Leave this field blank or enter an expression for the spreadsheet data range that PhixFlow will look in. The data that PhixFlow extracts from the range is defined in the File Columns section, below. The expression can specify:
You cannot specify:
If the worksheet name contains:
| ||||||||||||||||||||||
Ignore Undefined Values | Available when File Type is Excel Spreadsheet. When importing the file:
| ||||||||||||||||||||||
Maximum Excel File Size (MB) | Specify the maximum file size, in megabytes, to process. This prevents upload attempts on excessively large files from slowing down the server. The default is 0, which means no restriction. Specify a number greater than 0, for example | ||||||||||||||||||||||
File Password | Available if File Type is Excel Spreadsheet. If you are reading a spreadsheet which is password protected, enter the password here so that the file can be unlocked. | ||||||||||||||||||||||
Confirm Password | Available when File Type is Excel Spreadsheet. If you are reading a spreadsheet which is password protected, confirm the password here so that the file can be unlocked. | ||||||||||||||||||||||
Log Traffic |
|
File Columns
Anchor | ||||
---|---|---|---|---|
|
Available when File Type is Comma Separated Values, Fixed Length Records and Excel Spreadsheet. Enter the attributes of the data columns that you want to extract from the input file. The grid has the standard toolbar and the extra buttons:
Once you have uploaded a file, automatically populate the File Columns grid with the data attributes. PhixFlow samples some rows in the file to determine the values to use.Insert excerpt _attribute_populate _attribute_populate nopanel true
Open a repository tab listing all the streams.Insert excerpt _streams _streams nopanel true
Open a repository tab listing all the file collectors.Insert excerpt _file_collector _file_collector nopanel true
To add attributes, click
and to edit an attribute double-click on a row in the grid. PhixFlow opens an attribute form. Insert excerpt _add _add nopanel true
Field | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|
Name | Enter the name of the column, which can contain any combination of letters, numbers and _ the underscore character. If you use PhixFlow always uses this name to refer to this attribute. | ||||||||
Order | Enter a number that matches the column number in the input file. For example, if you want to extract the third, first and fifth column of data from a file, the three rows in this grid will have the order:
| ||||||||
Type | Enter one of the data types:
If you use | ||||||||
Length | Enter the maximum length of the field in the input file
This is:
If you use |
XML Namespaces
This section is available when File Type is XML. It has a toolbar with standard buttons. The grid contains a list of the namespaces defined in an XML response.
To add a namespace to the list, click
Insert excerpt | ||||||
---|---|---|---|---|---|---|
|
Insert excerpt | ||||||
---|---|---|---|---|---|---|
|
File Format Description
Available when File Type is Binary File. Enter details about the binary input file format and the data you want to extract.
Field | Description | |||||
---|---|---|---|---|---|---|
Validate File Format | Tick to indicate you have completed the properties and the XML description matches the file format. | |||||
Stream Item Node | Enter an expression for a string or list of strings. Each string is a node name in the binary file that will generate an output record.
| |||||
File Format Description | Enter an expression, using XML Binary File Grammar, describing the format of data in the file. |
Error Handling
Anchor | ||||
---|---|---|---|---|
|
All the properties that support error handling are documented individually above; this is a summary of these features, and what to consider when designing the error handling needed for the files you are loading.
Ignore Missing Columns
If you tick Advanced → Ignore Missing Columns you will still import rows which are missing columns. The missing columns will give you blank values in the stream for the missing fields.
However, PhixFlow starts lining columns up from the left, based on the idea that if there are missing columns, they will be missing from the right hand side. This means if columns are missing from somewhere in the middle or at the beginning of the line, the line may fail to import if the data types don't line up. However, this is not an error trap, it is arbitrary - if you think lines might be missing values in the middle or at the beginning of lines you should be careful about using this option – in any case, you will need further validation.
Ignore Extra Columns
If you tick Advanced → Ignore Extra Columns - again, this assumes that extra columns will appear on the right. If they appear in the middle or at the beginning of the row, the row may or may not import depending on how the data types of the resulting record line up with a standard record. Again, if you think this may occur, you need further validation.
Errors Before Rollback
If you set a number in Advanced → Errors Before Rollback – providing that, across the run (not individual files), the error count is less than the threshold you have set - this will load all records that are not in error. You will get a warning message about any that fail in the console – with the file name, and details of the line that failed. But these are essentially discarded from the import. These files will then be placed in the archive directory.
If, across the run, the threshold is reached – all files that have been processed up to that point will be placed in the error directory, including files don’t contain errors (because these are associated with a failed run). The run will be in error - that is, a red line in the console, the resulting data set for the run (the stream set) will be invalid, and therefore not available to the next step in your process. Any files remaining after the error threshold was reached will remain, untouched, in the input directory.
Supported Formats and Values
Supported Date/Datetime Format Patterns
Anchor | ||||
---|---|---|---|---|
|
The following formats are available for use in Date and Datetime type fields:
Valid Date Formats | Valid Datetime Formats |
---|---|
dd/MM/yy dd/MMM/yy dd/MM/yyyy dd/MMM/yyyy dd-MM-yy dd-MMM-yy dd-MM-yyyy dd-MMM-yyyy MM/dd/yy MMM/dd/yy MM/dd/yyyy MMM/dd/yyyy MM-dd-yy MMM-dd-yy MM-dd-yyyy MMM-dd-yyyy yyyyMMdd | dd/MM/yy HH:mm:ss dd/MMM/yy HH:mm:ss dd/MM/yyyy HH:mm:ss dd/MMM/yyyy HH:mm:ss dd-MM-yy HH:mm:ss dd-MMM-yy HH:mm:ss dd-MM-yyyy HH:mm:ss dd-MMM-yyyy HH:mm:ss MM/dd/yy HH:mm:ss MMM/dd/yy HH:mm:ss MM/dd/yyyy HH:mm:ss MMM/dd/yyyy HH:mm:ss MM-dd-yy HH:mm:ss MMM-dd-yy HH:mm:ss MM-dd-yyyy HH:mm:ss MMM-dd-yyyy HH:mm:ss yyyyMMdd.HHmmss |
The symbols used in these formats are explained in the following table
Symbol | Meaning | Presentation | Examples |
---|---|---|---|
y | year | year | 1996 |
M | month of year | month | Jul; 07 |
d | day of month | number | 10 |
H | hour of day (0~23) | number | 0 |
m | minute of hour | number | 30 |
s | second of minute | number | 55 |
The number of letters used in the pattern determines the format.
- Number: The minimum number of digits. Shorter numbers are zero-padded to this amount.
- Year: Numeric presentation for the year field are handled specially. For example, if the count of 'y' is 2, the year should be displayed as the zero-based year of the century, which is two digits.
- Month: 3 or over, use text, otherwise use number.
Supported TrueFalse Values
Anchor | ||||
---|---|---|---|---|
|
...
The following values are available in upper, lower and mixed cases for use in the TrueFalse type field:
Valid True Values | Valid False Values |
---|---|
true,yes,T,Y,1 | false,no,F,N,0 |
Form Icons
The form provides the standard form icons.
File Collector Attributes
...
File Collector Attributes
Anchor | ||||
---|---|---|---|---|
|
You can use the following PhixFlow internal variables to specify the attributes you want to load using a file collector. These attributes are available for all file types.
Attribute | Description |
---|---|
_fileName | The name of the file. |
_lineNumber | The line number of the record within the file it was read from. The _lineNumber attribute is not available for file collectors of File |
...
Typeis File Details Only. | |
_modifiedDate | The datetime of when the file was last modified. The last modified time of a single file residing within a .gz or a .tgz container can not be determined by phixflow, instead the datetime of when the corresponding gz/tgz container was created will be returned. |
_path | The full path to the file which is the result of concatenating the _rootDirectory and the _subDirectory values. |
_rootDirectory | The root base directory (if specified) concatenated with the value evaluated in the Collectors 'Input Directory Expr' field. |
_size | The size of the file in bytes. The size of a single file residing within a .gz or a .tgz container can not be determined by phixflow, instead a size of -1 will be returned. |
_subDirectory | The sub-directory relative to the _rootDirectory in which the corresponding file resides. |
_worksheet | The name of the current worksheet of the |
...
Excel file. The _worksheet is |
...
only available if |
...
the File Type is Excel Spreadsheet. | |
_range | The |
...
Excel range expression that was used. The _range |
...
attribute is only available if |
...
the File Type is Excel Spreadsheet. |
Handling Compressed Files
Anchor | ||||
---|---|---|---|---|
|
...
In the majority of cases a compressed file will just contain a single file.
...
For example, simple zip file called DailyCalls.zip would contain a single file named DailyCalls.csv.
However, some compressed files contain directories, sub-directories, files and further compressed files. In such cases the compressed file can be thought of as a directory, and further, any compressed files within the compressed file can be thought of as directories in the directory structure inside the compressed file. Therefore,
...
compressed files are treated like normal directories and obey the same rules when matching the
...
Directory Pattern Expression
...
and the
...
Exclude Dir Pattern Expression
...
. Similarly all directories, sub-
...
directories, and compressed files within a compressed file will also be treated as normal directories when matching the
...
Directory Pattern Expression
...
and the
...
Exclude Dir Pattern Expression
...
. Files contained anywhere inside the directory structure in the compressed file (including files contained in a compressed file within the compressed file) are treated as normal files when matching the
...
File Pattern Expression
...
.
Supported Compressed Files
Compression Type | Files ending with extension | Description |
---|---|---|
zip | ".zip" | A zip archive created by either windows programs such as winzip etc or unix commands such as zip. |
...
For example, to create a compressed zip file called dailyCalls.zip that includes a single file called dailyCalls_20120918.csv: |
...
|
...
| ||
tar | ".tar" | A tar archive created by the unix tar command. |
...
For example to create a tar file called dailyCalls.tar that includes a single file called dailyCalls_20120918.csv: |
...
|
...
| ||
gz | ".gz" | A gz archive created by the unix gzip command |
...
. For example, to create a compressed gz file called dailyCalls_20120918.csv.gz |
...
that includes a single file called dailyCalls_20120918.csv. |
...
The unix gzip command always assumes the named container has a single file of the same name contained within. | ||
tgz | ".tgz" | A joint tarred gz archive created by combining both the tar and gzip commands into a single command |
...
. For example, to create a compressed tgz file called dailyCalls.tgz |
...
that includes a single file called dailyCalls_20120918.csv |
...
:
|
Note |
---|
There is currently no support for rar type compressions. |
File Compression Examples
The following table shows how each compressed file found will be treated given the following values for 'File Pattern Expression', 'Directory Pattern Expression' and the 'Exclude Dir Pattern Expression'.
Compressed File Name | Compressed File Sub System | File Pattern Expression | Directory Pattern Expression | Exclude Dir Pattern Expression | Matching/Processed Files |
---|---|---|---|---|---|
DailyCalls10.zip | /DailyCalls10.csv | ".*Calls10.*" | ".* |
...
DailyCalls10.zip/DailyCalls10.csv | |||||
DailyCalls.tar | /subdir1/calls10.csv /subdir1/calls20.csv /subdir2/calls100.csv /subdir2/calls200.csv /subdir3/calls1000.csv /subdir3/calls2000.csv | ".*calls10.*" | ".* | ".*subdir2.* | DailyCalls.tar/subdir1/calls10.csv DailyCalls.tar/subdir3/calls1000.csv |
Outer.zip | /subdir1/calls10.csv /subdir1/calls20.csv /subdir1/Inner.zip/innerdir/calls100.csv /subdir1/Inner.zip/subdir2/calls1000.csv Note that Outer.zip contains a compressed zip file called Inner.zip | ".*calls10.*" | ".*subdir1.* | ".*subdir2.* | Outer.zip/subdir1/calls10.csv Outer.zip/subdir1/Inner.zip/innerdir/calls100.csv |
Outer.tar.gz | /Outer.tar/subdir1/calls10.csv /Outer.tar/innerdir/calls100.csv /Outer.tar/subdir1/Inner.zip/innerdir/calls1000.csv Note that Outer.tar.gz contains a tar container which in turn contains a compressed zip file called Inner.zip | ".*calls10.*" | ".*subdir1.*innerdir.* |
...
Outer.tar.gz/Outer.tar/subdir1/Inner.zip/innerdir/calls1000.csv |
...
Anchor |
---|
The form provides the standard form icons as well as the following:
...
...
Shows the model predecessors of the file collector.
The form also provides the following icons on the File Columns tab:
...
...
If a valid location has been configured in the file collector to locate an existing CSV file, the user can click on a button at the top of the grid to automatically create the file column descriptions in this form.
The column names are taken from the first row of the file. To construct the name all invalid characters are stripped out of the value found in each cell and the result is assumed to be the name of the column.
The remaining rows are examined to try to determine the type and length for each column definition based on the values found in the file. If a type cannot be determined then the column is defined as a string. The length of the field is set to be the length of the longest value found.
...
...
Shows the list of File Collectors.
...
...
Shows the list of Streams.
...
...
Deletes the selected object from the list.
...
...
Adds a new File Attribute. See the File Collector Attribute Details form.
See Also
...
|
With PhixFlow, you can quickly and easily load all the data from a worksheet in an Excel file, without having to set all the different file collector and stream properties.
- Drag a file collector into an analysis model.
- In the file collector properties, enter a name for the collector. Leave Auto Configure ticked.
- Hover your mouse pointer over the file collector and click
Managed File.Insert excerpt _upload_file _upload_file nopanel true - Find and select the Excel spreadsheet you want to load into PhixFlow. Click Open then
.Insert excerpt _upload_button _upload_button nopanel true - For an
.xlsx
file only, PhixFlow prompts you to specify the worksheet that you want to upload to the file collector. - PhixFlow automatically:
- uploads the Excel data:
- from the specified worksheet in an
.xlsx
file. - from the first worksheet in an
.xls
file.
- from the specified worksheet in an
- sets the file collector properties
- creates a stream
- sets the stream properties, including adding attributes for each data column in the Excel spreadsheet.
- uploads the Excel data:
You cannot use the Auto Configure option to:
- select specific Excel data columns to load
- always load the latest version of an Excel worksheet when you run analysis on the model
- load a data file that is not an Excel file.