Wiki

Scale Your Enterprise

User Tools

Site Tools


bw:file_reader_tool

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
bw:file_reader_tool [2019/01/02 11:36]
_deletedUser4_ created
bw:file_reader_tool [2020/09/15 14:28] (current)
Line 1: Line 1:
-====== Introduction ======+====== Introduction (File Reader) ======
  
-This document 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+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:application_introduction|Bizweaver – Application Introduction]] +
-  * [[bw:file_operations_tool|Bizweaver – File Operations Tool]] +
-  * Bizweaver – Looping Tool +
-  * [[bw:using_variables|Bizweaver – Using Variables]] +
-  * Bizweaver – Webservice Tool +
- +
-====== General Workflow Step Information ====== +
- +
-  - Each workflow step must have a unique **Name**. +
-    - The application will assign a default name, but we recommend that you change the name to something that helps you understand the purpose of the step as it is used in other steps. +
-    - The name cannot have spaces or special characters other than and underscore (_) +
-  - Enter an optional **Description** to provide any additional information that may be helpful to understanding the step. +
-  - Press <**F4**> to find and use values from previous workflow steps.+
  
 ===== Special Note ===== ===== Special Note =====
Line 31: Line 9:
 </WRAP> </WRAP>
  
 +====== FileReader Tool ======
 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 **//[[bw:web_service_tool|Webservice Tool]]//** page.
  
 File delimiters include: File delimiters include:
Line 59: Line 37:
 ====== Delimited Files ====== ====== Delimited Files ======
  
-{{:bw:frimage1.png?384x459}}+{{ :bw:frimage1.png?384x459 }}
  
 Example showing static file name. Example showing static file name.
  
-{{:bw:frimage2.png?384x460}}+{{ :bw:frimage2.png?384x460 }}
  
 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. \\ {{ :bw:frimage3.png?309x103 }} 
- +      - If the “Custom Separated” delimiter option is selected, an additional field is displayed below the Input/File field. Enter the delimiter character here. 
-{{:bw:frimage3.png?309x103}} +  - The **File Reader** option requires either a specific source file path & name or a Bizweaver variable that identifies the source file. 
- +      - A specific file is a reasonable option if the source file name is always the same. 
-  - 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 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**. 
-<HTML><ol start="2" style="list-style-type: decimal;"></HTML> +      - See **//[[bw:file_reader_tool#appendix_a_-_file_operations_variables|Appendix A - File Operations Variables]]//** for definitions of the options available using step variables. 
-<HTML><li></HTML><HTML><p></HTML>The **File Reader** option requires either a specific source file path & name or a Bizweaver variable that identifies the source file.<HTML></p></HTML> +  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. 
-<HTML><ol start="2" style="list-style-type: decimal;"></HTML> +      - Best practice is to place the template files in their own folder so they are not mixed with files to be processed. 
-<HTML><li></HTML><HTML><p></HTML>A specific file is a reasonable option if the source file name is always the same.<HTML></p></HTML><HTML></li></HTML> +      The column structure and sample data from the template file are displayed in the area below the template file name. 
-<HTML><li></HTML><HTML><p></HTML>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.<HTML></p></HTML><HTML></li></HTML> +  Select the **No header row** option if the source files do not have a header row. 
-<HTML><li></HTML><HTML><p></HTML>**Wildcard file designations are not permitted for the file reader. Use the Get Files tool (File Operations) to process multiple files**.<HTML></p></HTML><HTML></li></HTML> +      - Use of a header row is not required. However, all files to be processed through this File Reader step must be consistent; header or no header. 
-<HTML><li></HTML><HTML><p></HTML>See [[#appendix-a---file-operations-variables|//Appendix A - File Operations Variables//]] for definitions of the options available using step variables.<HTML></p></HTML><HTML></li></HTML><HTML></ol></HTML> +  Files with, and without header rows are supported (this does not apply to XML and JSON files). There are some basic rules about the column headers. 
-<HTML></li></HTML> +      - The name cannot have spaces and should typically not have special characters other than an underscore ( _ ). 
-<HTML><li></HTML><HTML><p></HTML>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.<HTML></p></HTML> +      The name should be relatively short but should be descriptive enough so that its purpose is apparent.
-<HTML><ol start="6" style="list-style-type: decimal;"></HTML> +
-<HTML><li></HTML><HTML><p></HTML>Best practice is to place the template files in their own folder so they are not mixed with files to be processed.<HTML></p></HTML><HTML></li></HTML> +
-<HTML><li></HTML><HTML><p></HTML>The column structure and sample data from the template file are displayed in the area below the template file name.<HTML></p></HTML><HTML></li></HTML><HTML></ol></HTML> +
-<HTML></li></HTML> +
-<HTML><li></HTML><HTML><p></HTML>Select the **No header row** option if the source files do not have a header row.<HTML></p></HTML> +
-<HTML><ol start="8" style="list-style-type: decimal;"></HTML> +
-<HTML><li></HTML><HTML><p></HTML>Use of a header row is not required. However, all files to be processed through this File Reader step must be consistent; header or no header.<HTML></p></HTML><HTML></li></HTML><HTML></ol></HTML> +
-<HTML></li></HTML> +
-<HTML><li></HTML><HTML><p></HTML>Files with, and without header rows are supported (this does not apply to XML and JSON files). There are some basic rules about the column headers.<HTML></p></HTML> +
-<HTML><ol start="9" style="list-style-type: decimal;"></HTML> +
-<HTML><li></HTML><HTML><p></HTML>The name cannot have spaces and should typically not have special characters other than an underscore ( _ ).<HTML></p></HTML><HTML></li></HTML> +
-<HTML><li></HTML><HTML><p></HTML>The name should be relatively short but should be descriptive enough so that its purpose is apparent.<HTML></p></HTML><HTML></li></HTML><HTML></ol></HTML> +
-<HTML></li></HTML><HTML></ol></HTML> +
 ====== XML & JSON Files ====== ====== XML & JSON Files ======
  
Line 104: 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.
  
-{{:bw:frimage4.png?325x384}}+{{ :bw:frimage4.png?325x384 }}
  
 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. 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.
Line 110: 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.
  
-{{:bw:frimage5.png?276x288}}+{{ :bw:frimage5.png?276x288 }}
  
 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 116: 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”, so the /root level must be selected as well as /root/RateResults. When this is done we get the following results: 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:
  
-{{:bw:frimage6.png?288x144}}+{{ :bw:frimage6.png?288x144 }}
  
 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:
  
-{{:bw:frimage7.png?264x121}}+{{ :bw:frimage7.png?264x121 }}
  
 Note that we must include /root and /root/RateResults as well, since “Charges” is a sub-group of /root/RateResults. Note that we must include /root and /root/RateResults as well, since “Charges” is a sub-group of /root/RateResults.
Line 126: Line 90:
 With this change we now see: With this change we now see:
  
-{{:bw:frimage8.png?288x140}}+{{ :bw:frimage8.png?288x140 }}
  
 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 142: 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.
  
-{{:bw:frimage9.png?288x209}}+{{ :bw:frimage9.png?288x209 }}
  
 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 150: 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:\SourceFolder”. 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**                 ^ +^**Variable Name**     ^**Explanation**                                   ^**Example**                 ^  
-|File Name             |Full file name including path (folder)            |C:\SourceFolder\FileName.txt| +|File Name             |Full file name including path (folder)            |C:\SourceFolder\FileName.txt|  
-|File Title            |The file name including the extension             |FileName.txt                | +|File Title            |The file name including the extension             |FileName.txt                |  
-|File Title without Ext|The file name without the extension               |FileName                    | +|File Title without Ext|The file name without the extension               |FileName                    |  
-|File Extension        |The file extension **including** the “.” separator|**.**txt                    | +|File Extension        |The file extension **including** the “.” separator|**.**txt                    |  
-|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                           |C:\SourceFolder             | +|Source Path           |Path of the source file                           |C:\SourceFolder             |  
-|Source File Name      |“File” name as defined in a Get Files action      |Example: “*FileName.txt”    | +|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 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”    +|Target File Name      |“File” name as defined in a File Writer action    |Example: “*FileName.txt”    | 
-|                      |                                                  |                            |+
  
bw/file_reader_tool.1546446995.txt.gz · Last modified: 2019/01/02 11:36 by _deletedUser4_