This page describes the use of the “File Reader” tool in Bizweaver. Information regarding the associated File Operations and File Writer tools is found in separate documents.
Beginning in Bizweaver v2.0.170, two File Reader tools are displayed: FileReader and FileReader2. The functions are the same in both tools except for changes for handling XML and JSON files found in FileReader2. While workflows created using FileReader will continue to function, any new workflows should use FileReader2. All references to “FileReader” in this section refer to FileReader2.
The File Reader tool is used to read data from “flat” delimited files and “structured” formats such as XML, JSON, and Microsoft Excel. There is also a special input type called “text reader.” Data read from the file is then available in subsequent processing steps.
The File Reader tool is also used to process data being received from a webservice call. More information on this process can be found in the Webservice Tool page.
File delimiters include:
“Structured” file formats include:
Example showing static file name.
Example showing input from Get File operation
XML (eXtensible Markup Language) and JSON (JavaScript Object Notation) are structured formats commonly used with websites.
The setup for these formats is the same as described for delimited files, with one exception. When either of these formats is the source, the tool has additional functionality to deal with the hierarchy structures often found in these files. The tool “flattens” the data so that it can be used is subsequent processing.
The sample used for explanation of handling these types of structures is JSON input returned from a web service call. The data being processed is freight carrier information.
The “Use Null Value” option is used in cases where some records in the input file do not have any data. In these cases, the columns can become “mismatched,” causing problems correctly reading the data. The ”null value” option accounts for these missing values based on the template.
When the input is XML or JSON, a new link named “Select object for formatting the data” is displayed. Click on this link to open a new dialog.
This dialog presents the various data groupings (nodes) in the input structure. Select a combination of checkboxes to “flatten” the data to the selected level.
To get the desired results, you must select all the associated higher-level nodes as well. In the first example we want just “RateResults”, so the /root level must be selected as well as /root/RateResults. When this is done we get the following results:
If we now want to get the “Charges” data, we change the object select to look like this:
Note that we must include /root and /root/RateResults as well, since “Charges” is a sub-group of /root/RateResults.
With this change we now see:
If the input structure is complex, you may need to use multiple FileReader steps (with a common input) to get all the data elements you need.
Effective with v91.1.0.161, Bizweaver can process native Microsoft Excel (.xlsx) files. The only limitation is that only the first worksheet in a workbook is processed. The processing of multiple sheets in a workbook is not supported.
The setup for Excel files is the same as described for delimited files.
The Excel file reader requires that the Microsoft Access Database Runtime engine be installed on the Bizweaver server. Contact Third Wave support to obtain the installation package for this application.
The Text Reader option is used when the input file needs to be read as a single string of text. The uses for this option are very specialized and limited.
The only input for this function is a file name, or workflow variable that identifies the file.
There are several variables from the File Operations function that can be used in other workflow steps. In the following examples the file being addressed is named “FileName.txt” and it is found in the folder “C:\SourceFolder”.
| Variable Name | Explanation | Example |
|---|---|---|
| File Name | Full file name including path (folder) | C:\SourceFolder\FileName.txt |
| File Title | The file name including the extension | FileName.txt |
| File Title without Ext | The file name without the extension | FileName |
| File Extension | The file extension including the “.” separator | .txt |
| File Type | File type such as TAB, csv, etc. | |
| Source Path | Path of the source file | C:\SourceFolder |
| Source File Name | “File” name as defined in a Get Files action | Example: “*FileName.txt” |
| Target Path | Path name from a File Writer operation | C:\TargetFolder |
| Target File Name | “File” name as defined in a File Writer action | Example: “*FileName.txt” |