# HG changeset patch # User František Kučera # Date 1591612456 -7200 # Node ID 7029e6c477003de56356bf8e585ddbcdb8e59c8a # Parent b9bd0f06b4a130c3b94b99d119abd1dbc3126213 examples: improved Doing projection and restriction using cut and grep – add a chapter about CSV diff -r b9bd0f06b4a1 -r 7029e6c47700 relpipe-data/examples-grep-cut-fstab.xml --- a/relpipe-data/examples-grep-cut-fstab.xml Sat Jun 06 13:22:57 2020 +0200 +++ b/relpipe-data/examples-grep-cut-fstab.xml Mon Jun 08 12:34:16 2020 +0200 @@ -165,6 +165,59 @@ The letters relation stays rock steady and relpipe-tr-cut 'numbers' does not affect it in any way.

+

Process CSV files

+ +

+ There are various input filters (relpipe-in-*), one of them is relpipe-in-csv + which converts CSV files to relational format. + Thus we can process standard CSV files in our relational pipelines + and e.g. filter records that have certain value in certain column (relpipe-tr-grep) + or keep only certain columns (relpipe-tr-cut). +

+ +

+ We may have a tasks.csv file containing TODOs and FIXMEs: +

+ +
+ +

+ And we can process it using this pipeline: +

+ + + +

and get result like this:

+ +
+ + +

+ We work with attribute (column) names, so there is no need to remember column numbers. + And thanks to regular expressions we can write elegant and powerful filters. +

+ + +