This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
bw:file_reader_tool [2019/03/07 11:42] runger |
bw:file_reader_tool [2020/09/15 14:28] (current) |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Introduction (File Reader) ====== | ====== Introduction (File Reader) ====== | ||
| - | This document | + | 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. |
| - | + | ||
| - | ====== Audience ====== | + | |
| - | + | ||
| - | This document is intended for developers of Bizweaver workflows. | + | |
| - | + | ||
| - | ====== Related Documents ====== | + | |
| - | + | ||
| - | The following documents contain additional information that may be helpful with the development of Bizweaver workflows. | + | |
| - | + | ||
| - | * [[bw: | + | |
| - | * [[bw: | + | |
| - | * [[bw: | + | |
| - | * [[bw: | + | |
| - | * [[bw: | + | |
| ===== Special Note ===== | ===== Special Note ===== | ||
| Line 26: | Line 12: | ||
| 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 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 “Bizweaver – Webservice Tool” document. | + | 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 **// |
| File delimiters include: | File delimiters include: | ||
| Line 51: | Line 37: | ||
| ====== Delimited Files ====== | ====== Delimited Files ====== | ||
| - | {{: | + | {{ : |
| Example showing static file name. | Example showing static file name. | ||
| - | {{: | + | {{ : |
| Example showing input from Get File operation | Example showing input from Get File operation | ||
| - | - Select the delimiter type from the drop-down list. \\ {{: | + | - Select the delimiter type from the drop-down list. \\ {{ : |
| - If the “Custom Separated” delimiter option is selected, an additional field is displayed below the Input/File field. Enter the delimiter character here. | - If the “Custom Separated” delimiter option is selected, an additional field is displayed below the Input/File field. Enter the delimiter character here. | ||
| - The **File Reader** option requires either a specific source file path & name or a Bizweaver variable that identifies the source file. | - The **File Reader** option requires either a specific source file path & name or a Bizweaver variable that identifies the source file. | ||
| Line 65: | Line 51: | ||
| - If the source file name may not always be the same, then the Get Files tool should be used as a feed into a looping cycle where the FileReader tool is a step within the loop. | - If the source file name may not always be the same, then the Get Files tool should be used as a feed into a looping cycle where the FileReader tool is a step within the loop. | ||
| - **Wildcard file designations are not permitted for the file reader. Use the Get Files tool (File Operations) to process multiple files**. | - **Wildcard file designations are not permitted for the file reader. Use the Get Files tool (File Operations) to process multiple files**. | ||
| - | - See [[bw: | + | - See **//[[bw: |
| - The File Reader requires the use of a “template” file. This is simply an abbreviated version of the file to be processed. The template is used to define the expected columns when reading an input file. | - The File Reader requires the use of a “template” file. This is simply an abbreviated version of the file to be processed. The template is used to define the expected columns when reading an input file. | ||
| - Best practice is to place the template files in their own folder so they are not mixed with files to be processed. | - Best practice is to place the template files in their own folder so they are not mixed with files to be processed. | ||
| Line 82: | Line 68: | ||
| 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 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, | 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, | ||
| Line 88: | Line 74: | ||
| 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. | 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. | 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. | ||
| Line 94: | Line 80: | ||
| To get the desired results, you must select all the associated higher-level nodes as well. In the first example we want just “RateResults”, | To get the desired results, you must select all the associated higher-level nodes as well. In the first example we want just “RateResults”, | ||
| - | {{: | + | {{ : |
| If we now want to get the “Charges” data, we change the object select to look like this: | 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 / | Note that we must include /root and / | ||
| Line 104: | Line 90: | ||
| With this change we now see: | 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. | 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. | ||
| Line 120: | Line 106: | ||
| 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 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. | The only input for this function is a file name, or workflow variable that identifies the file. | ||
| Line 128: | Line 114: | ||
| 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: | 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: | ||
| - | ^**Variable Name** | + | ^**Variable Name** |
| - | |File Name |Full file name including path (folder) | + | |File Name |Full file name including path (folder) |
| - | |File Title |The file name including the extension | + | |File Title |The file name including the extension |
| - | |File Title without Ext|The file name without the extension | + | |File Title without Ext|The file name without the extension |
| - | |File Extension | + | |File Extension |
| - | |File Type |File type such as TAB, csv, etc. | | | + | |File Type |File type such as TAB, csv, etc. | | |
| - | |Source Path |Path of the source file | + | |Source Path |Path of the source file |
| - | |Source File Name |“File” name as defined in a Get Files action | + | |Source File Name |“File” name as defined in a Get Files action |
| - | |Target Path |Path name from a File Writer operation | + | |Target Path |Path name from a File Writer operation |
| - | |Target File Name |“File” name as defined in a File Writer action | + | |Target File Name |“File” name as defined in a File Writer action |
| - | | | | | + | |