Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Learning Pentaho Data Integration 8 CE - Third Edition

You're reading from  Learning Pentaho Data Integration 8 CE - Third Edition

Product type Book
Published in Dec 2017
Publisher Packt
ISBN-13 9781788292436
Pages 500 pages
Edition 3rd Edition
Languages

Table of Contents (23) Chapters

Title Page
Credits
About the Author
About the Reviewers
www.PacktPub.com
Customer Feedback
Preface
Getting Started with Pentaho Data Integration Getting Started with Transformations Creating Basic Task Flows Reading and Writing Files Manipulating PDI Data and Metadata Controlling the Flow of Data Cleansing, Validating, and Fixing Data Manipulating Data by Coding Transforming the Dataset Performing Basic Operations with Databases Loading Data Marts with PDI Creating Portable and Reusable Transformations Implementing Metadata Injection Creating Advanced Jobs Launching Transformations and Jobs from the Command Line Best Practices for Designing and Deploying a PDI Project

Filtering data


By now, you have learned how to do several kinds of calculations which enrich the set of data. There is still another kind of operation that is frequently used; it does not have to do with enriching the data but with discarding or filtering unwanted information. That's the core of this section.

Filtering rows upon conditions

Suppose you have a dataset and you only want to keep the rows that match a condition. To demonstrate how to implement this kind of filtering, we will read a file, build a list of words found in the file, and then filter the nulls or unwanted words. We will split the exercise into two parts:

  • In the first part, we will read the file and prepare the data for filtering
  • In the second part, we will effectively filter the data

Reading a file and getting the list of words found in it

Let's start by reading a sample file.

Note

Before starting, you'll need at least one text file to play with. The text file used in this tutorial is named smcng10.txt. Its content is about...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}