Skip to main content
PI System
Data Processing
CSV Handling

A Guide to Filtering and Processing CSV Data Using PI UFL

Learn how to effectively filter and process CSV data using PI UFL to ensure seamless integration into the PI System.

Roshan Soni

4 min read

A Guide to Filtering and Processing CSV Data Using PI UFL

In today's data-driven world, the ability to efficiently manage and process data across multiple sites is pivotal for any organization. One common challenge faced by many companies is dealing with varied CSV files containing site-specific data yet conforming to a single template. PI UFL (Universal File Loader) offers a robust solution for this, allowing for effective data filtration and extraction, enabling the seamless transfer of vital data into the PI System.

Understanding PI UFL

PI UFL is a tool that facilitates the importing of unstructured data from files into the PI System. It utilizes configuration files (.INI files) to parse the data, transforming it into structured PI Tags. This flexibility is particularly useful when dealing with CSV files from various sites that require a unified approach to data processing.

Problem Statement

Imagine having a single folder containing CSV files, each named differently for different sites, but all following the same data template. The goal is to filter and store specific location data into appropriate PI Tags using a single UFL INI File.

Strategy for Filtering and Storing Data

  1. File Navigation and Initial Setup

    • Ensure that all CSV files are located in a single directory accessible to the PI UFL system.
    • Develop a plan for handling filenames to identify data origins during the UFL parsing process.
  2. Utilizing IF Statements for Filtration

    • Leverage IF statements within the INI configuration to distinguish between location-specific data. This is crucial for deciding which lines of data should be processed and stored.
    • Example configuration line:
      IF (Location == "desired_location") THEN
         ... [process data] ...
      END IF
      
    • Such logic ensures that only data relevant to specified locations is extracted, reducing unnecessary data processing.
  3. Extracting Location Data

    • Use string manipulations to extract location information from the CSV lines. This involves understanding the structure of each line in the CSV.
    • An example extraction would look something like:
      Location = ["(*),*"]
      
    • This code takes everything before the first comma, assuming the location identifier precedes it.
  4. INI File Configuration

    • Develop a comprehensive INI configuration that considers each line of your CSV files as a text string. This approach simplifies the manipulation and extraction processes.
    • Engage in iterative testing to refine the configuration's effectiveness — preview, modify, test, and adjust.

Conclusion

PI UFL is a powerful utility that, when configured correctly, provides a streamlined approach to handling CSV file data across multiple sites. By strategically utilizing IF statements, extracting key information, and methodically configuring the INI files, you can ensure accurate data filtering and storage within PI Tags. This aligns operational data with business needs, enabling deeper insights and informed decision-making.

Further Reading

For those interested in deepening their understanding of PI UFL, I recommend exploring the official PI UFL user guide. Additionally, communities such as PI Square offer a wealth of shared strategies, experiences, and solutions that can enhance your data integration efforts with PI UFL.

Tags

#OSIsoft
#PI UFL
#Data Filtration
#CSV Processing
#PI System Integration

About Roshan Soni

Expert in PI System implementation, industrial automation, and data management. Passionate about helping organizations maximize the value of their process data through innovative solutions and best practices.

Sign in to comment

Join the conversation by signing in to your account.

Comments (0)

No comments yet

Be the first to share your thoughts on this article.

Related Articles

Enhancing PI ProcessBook Trends with Banding and Zones: User Needs, Workarounds, and the Road Ahead

A look at the user demand for trend banding/zoning in OSIsoft PI ProcessBook, current VBA workarounds, UI challenges, and how future PI Vision releases aim to address these visualization needs.

Roshan Soni

Migrating PIAdvCalcFilVal Uptime Calculations from PI DataLink to PI OLEDB

Learn how to translate PI DataLink's PIAdvCalcFilVal advanced calculations—like counting uptime based on conditions—into efficient PI OLEDB SQL queries. Explore three practical approaches using PIAVG, PIINTERP, and PICOunt tables, and get tips for validation and accuracy.

Roshan Soni

Understanding PI Web API WebID Encoding: Can You Generate WebIDs Client-Side?

Curious about how PI Web API generates WebIDs and whether you can encode them client-side using GUIDs or paths? This article explores the encoding mechanisms, current documentation, and best practices for handling WebIDs in your applications.

Roshan Soni

    A Guide to Filtering and Processing CSV Data Using PI UFL | Pisharp Blog | PISharp