The C++ DSV Filter Library is a simple to use, easy to integrate and extremely efficient
and fast CSV/DSV in-memory data store processing library. The DSV filter allows for the
efficient evaluation of complex expressions on a per row basis upon the loaded DSV store.
The accompanying example demonstrates very simple SQL-like processing capabilities for
filtering user specified DSV files.
Capabilities
The C++ DSV Filter Library has the following capabilities:
Arbitrarily complex expressions over columns composed of both strings and numbers
Selectable output columns
Extremely fast in-memory store
Memory mapped file option
Single header file solution requires no installation or building
C++ DSV Library License
Free use of the C++ DSV Library is permitted under the guidelines and in accordance
with the most current version of the "Common Public License."
Compatability
The C++ DSV Library implementation is fully compatible with the following C++ compilers:
In the following example, we have a table of OHLC values for a group of equities (GOOG and MSFT).
Furthermore we may wish to perform a series of queries that will extract the rows that match
various criteria.
The following are a few example queries:
volume >= 1000000 and symbol == 'GOOG'
abs(open - close) > abs(high - low)
avg(open,close,high,low)* volume > 10^7 and inrange('20090702',date,'20090730')
(open > close) and (symbol like '*FT*') and (date >= '20090101')
int main()
{
std::string file_name = "ohlc.txt";
dsv_filter filter;
if (!filter.load(file_name))
return 1;
std::string expression = "(open > close) and (symbol like '*FT*') and (date >= '20090101')";
filter.add_filter(expression);
for (std::size_t row = 1; row < filter.row_count(); ++row)
{
if (dsv_filter::e_match == filter[row])
{
// do something with row...
}
}
return 0;
}