tag:blogger.com,1999:blog-7979090406441748249.post6757784961594271830..comments2022-04-01T16:03:38.382+11:00Comments on My Byte of Code: Parse CSV File With Boost Tokenizer In C++Unknownnoreply@blogger.comBlogger4125tag:blogger.com,1999:blog-7979090406441748249.post-6455955456433733502011-01-23T18:52:40.879+11:002011-01-23T18:52:40.879+11:00Thanks! This was very helpful. I had another meth...Thanks! This was very helpful. I had another method, but it didn't like zero-length fields (i.e. commas with nothing between) and was slow. This is faster and handles it all.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-7979090406441748249.post-69871179718199529162010-11-20T05:14:46.904+11:002010-11-20T05:14:46.904+11:00I have added another post that shows one way of de...I have added another post that shows one way of dealing with the type of records with embedded line breaks and semi-colon separator http://mybyteofcode.blogspot.com/2010/11/parse-csv-file-with-embedded-new-lines.html .SBHackerhttps://www.blogger.com/profile/01138782967431023055noreply@blogger.comtag:blogger.com,1999:blog-7979090406441748249.post-85319429325891602032010-11-20T02:54:53.613+11:002010-11-20T02:54:53.613+11:00The code above will not be able to parse embedded ...The code above will not be able to parse embedded new line in a field as you show in your example in the first record. <br /><br />This is not an issue with the boost::tokenizer, you can specify ';' as delimiter.<br /><br />The issue is that the code above assumes records are stored one per line so a line at a time is read and parsed.<br /><br />The reading code could be adjusted to skim SBHackerhttps://www.blogger.com/profile/01138782967431023055noreply@blogger.comtag:blogger.com,1999:blog-7979090406441748249.post-58182216452615420082010-10-26T09:18:11.759+11:002010-10-26T09:18:11.759+11:00I wonder whether these tools are capable of parsin...I wonder whether these tools are capable of parsing lines with fields including unescaped newlines. For example:<br /><br />Name;Address;Sport<br />Joe Smith;"101 Main Street<br />Springfield, Anystate";Basketball<br />Will Brown;;BaseballAnonymousnoreply@blogger.com