Name-Value Pair

NameValuePair operations consist of the filters, transformers, and bufferings. Each of these are described in Basics and Reference documentation. Pnyx automatically converts Row data into NameValuePair data. The conversion requires the Row data to include a header for determining the names of each column. The rest of this page illustrates some usages these operations.

Filter

Example usage of automatically converting from Row data to NameValuePair data.

Filter:
 
const string csvInputA = """
Title,Author,PublicationDate
Tale of Two Cities,Charles Dickens,1859
Oliver Twist,Charles Dickens,1839
Odyssey,Homer,-1000
""";

await using Pnyx p = new Pnyx();
p.readString(csvInputA);
p.parseCsv(hasHeader: true);
p.rowToNameValuePair();
p.nameValuePairFilter(x => int.Parse(x["PublicationDate"]?.ToString() ?? "") >= 1840);
List<IDictionary<string, object?>> actual = await p.processCaptureNameValuePairs();
Console.WriteLine($"Matched {actual.Count} records");

Next

Suggested next steps:
  • Line, learn more about Line operations
  • Row, learn more about Row operations
  • Object, examples of Object operations
  • Output, learn more about Output operations
  • Settings, learn more about settings