My Byte of Code Blog. Tips and observations on creating software with Objective-C, C/C++, Python, Cocoa and Boost on Mac.

Showing posts with label trim. Show all posts
Showing posts with label trim. Show all posts

Wednesday, February 24, 2010

Parse CSV File With Boost Tokenizer In C++

Often data required by application are available in CSV formatted files. In c++ it is easy to read file line by line. All that is left is to extract fields from each line and insert them into datastructure stored in memory. Boost Tokenizer is a package that provides a way to easilly break a string or sequence of characters into sequence of tokens, and provides standard iterator interface to traverse the tokens. I will show simple way of using Boost Tokenizer to parse data from CSV file.