26 June 2005 - java_dev (original) (raw)

02:22 pm - sciamachy - Brainteaser for all you programmers out there I'm trying this thing where I have a CSV file being exported from SQL Server, and one of the fields is an XML page, so to speak. Inside this XML there may or may not be one or more commas. Now, if it weren't for that I could read it in using a BufferedReader and run it through a StringTokenizer with the delimiter set as ",", but because of the XML field's internal commas it's not that simple. How should I handle this best? The object of the program is to basically truncate any fields that exceed 256 characters, as it's to be imported into Excel later.Don't go doing the thing for me, but if you can show me with a little pseudocode I'd be very grateful.( Addendum and closureCollapse )