From: Jon Babcock Date: 2000-10-06T05:52:29+09:00 Subject: [ruby-talk:5310] Errata for Ruby Book? Does anyone have a URL for the errata for the Ruby Book? Turns out there are some differences between the printed book (of which I have a Xerox copy) and the electronic file that my agent has sent me. Not sure which one I should use as definitive. Is the Xerox or the electronic file correct? Here's an example (Up arrows underneath lines point to differences; all missing commas in this case.): Xerox of printed book (2000-2-1, 3rd printing of 1st edition): 3.1.3 CSV形式の文字列 [Strings in CSV form/format/syntax] [[[BTW, which of these is the preferred word here? (CSV = Comma Separated Values, I presume.) ]]] '1,2' は [signifies] ['1', '2'] を意味し、[and] '1,"2,3",4' は [signifies] ['1', '2,3', '4'] を意味します。 また、"""で括られたフィールド中では""""を"""に展開します ^ ^ ^ ^ [Moreover, in a field enclosed by """, """" is translated into """.] [[[I find this hard to follow.]]] '1,"2""3",4' ^ は [becomes] ['1', '2"3', '4'] になります。  CSV形式の文字列はsplitを単純に用いるだけではうまくいきません。 [For CSV strings, 'split' alone is inadequate.] >> '1,"2,3",4'.split(",") => ["1", "\"2", "3\"", "4"] ^ Electronic file given to me from agent: 3.1.3 CSV形式の文字列 '1,2' は ['1', '2'] を意味し、 '1,"2,3",4' は ['1', '2,3', '4'] を意味します。 また、",""で括られたフィールド中では","","を",""に展開します。 '1,"2","3",4' は ['1', '2"3', '4'] になります。  CSV形式の文字列はsplitを単純に用いるだけではうまくいきません。 >> '1,"2,3",4'.split(",") => ["1","\"2","3\",", "4"] Early on I had decided to follow the Xerox, but now I'm wondering ... Thanks. Jon -- Jon Babcock