Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

It is often useful to read a local or network directory and populate a PhixFlow stream with the names of the files. This can be used as a reference list for subsequent processing and can also form the basis of a duplicate detection pattern, ensuring that files are not processed mor more than once. The examples below show how to read the entire folder contents, as well as just speciifc specific file types.

Example 1: Read all files

...

  1. Add a File Collector to the model and confiure configure it as follows:
    1. Source Type = Specified Directory
    2. File Type = File Details Only
    3. File Location Strategy = All Files in Folder
    4. Input Directory Expression = Enter the name of the folder relative to the Import File Locaion Location in  System System Configuration. Put the folder name in double quotes e.g. "Data Files"
    5. File Pattern Expression = ".*." (This will read all file types)
  2. Make sure the Enabled and Allow on-Schedued Scheduled collection checkboxes are checked and then save and close the file colletorcollector
  3. Hover over the file collector and select Add a New Stream
  4. Add an attribute to the stream to hold the fie name and enter the expression "in._fileName" without the quotes.
  5. Run analysis on the stream and view the filenames 

 

 

 

...

  1. filenames

File Collector Configuration

Image Added

Attribute Expression to Read Filename

Image Added

 Example Folder and Results in PhixFlow

 Image AddedImage Added

Example 2: Read all files with a given file

...

extension

Step-by-step guide

...

This example shows how to modify the process to only read the csv files. This can be useful when there are multiple file types in a single folder and you want to have separate streams for each type, or just process them separately.

  1. Copy the file collector and stream using the following steps:
    1. Hold down shift and selecting the two objects by left-clicking on them
    2. Select Copy Selected Object
  2. Modify the Input Directory Expression on the new stream to ".*.csv" (This will read all file typesfiles of type csv)
  3. Make sure the Enabled and Allow on-Schedued collection checkboxes are  is checked and then save and close the file colletorHover over the file collector and select Add a New StreamAdd an attribute to the stream to hold the fie name and enter the expression "in._fileName" without the quotes.
  4. Run analysis on the stream and view the filenames filenames for the csv files

Copying Multiple PhixFlow Objects

 Image Added

Modified Expression to read just the CSV files

Image Added

 

...

Mode Ref: 004

Filter by label (Content by label)
showLabelsfalse
max5
spacesHELP70
showSpacefalse
sortmodified
reversetrue
typepage
cqllabel = "kb-how-to-article" and type = "page" and space = "HELP70"
labelskb-how-to-article

...