> IMHO, the language used to handle CSV files is not all that important. > What is important is having a library of CSV tools. Most > Pascal & c compilers have at least a start in this direction > but normally refer to them as "String" operations. > > Far down my list of "things to do" is refresh my memory on > the subject in Pascal but having access to Excel has made me > lazy when dealing with CSV files... Excel gets it wrong too, but that's more a case of people not generating CSV files properly in the first place. As Rolf pointed out, it's not that simple. His example may have been a single item, which would have needed another set of quotes to encompass it all. I usually do TAB delimited :) You may have to Google 'recursive descent parser' for some ideas, the general idea is you keep shoving stuff onto a stack until you find the 'end', then you work back up. (It's been years since I've done this.) It gets tricky with something like "x","","""x""" (really x,,"x"). Hitting a single quote means you need to find a closing quote, and then a comma. Hitting a double quote means either a blank string (yeah, people do that), or it's an escaped single quote, the 3rd item is literally "x". The following chars set the context. Toss it on the stack, check the next char(s), then decide. Here's something to ponder: """",",","""","," - what's that? People can't even get apostrophes right in SQL. (Have a look at some lyrics site, they just drop them!) Tony -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist