CSV.readでブロック


#1

e$B$3$s$K$A$O!";3K$H$b$&$7$^$9!#e(B

trunke$B$Ge(BCSVe$B$GF|K\8l$N%U%!%$%k$rFI$9~$b$&$H$7$?$H$3$m!"e(B
e$B%V%m%C%/$7$F$7$^$&8=>]$r$
$D$1$^$7$?!#e(B

e$B>:Y$ODI$$$+$1$F$$$J$$$N$G$9$,!"e(B
1024e$B%P%$%H0J>e$N%G!<%?$rFI$_9~$`:]$K!"e(B
e$B%(%s%3!<%I<~$j$r860x$H$7$?e(B
e$BL58B%j%H%i%$$K$J$C$F$$$k$h$&$G$9!#e(B

$ cat csv_block.rb

-- coding: utf-8 --

require csv

fn = a.csv
open(fn, w){|f| f.write("e$B$e(B*342) }
CSV.read(fn, {:encoding => utf-8})

$ ruby -v csv_block.rb
ruby 1.9.2dev (2009-03-03 trunk 22714) [i686-linux]
^C/usr/local/lib/ruby/1.9.2/csv.rb:2264:in block in encode_str': Interrupt from /usr/local/lib/ruby/1.9.2/csv.rb:2264:inmap
from /usr/local/lib/ruby/1.9.2/csv.rb:2264:in encode_str' from /usr/local/lib/ruby/1.9.2/csv.rb:2278:inread_to_char
from /usr/local/lib/ruby/1.9.2/csv.rb:1990:in init_separators' from /usr/local/lib/ruby/1.9.2/csv.rb:1570:ininitialize
from /usr/local/lib/ruby/1.9.2/csv.rb:1330:in new' from /usr/local/lib/ruby/1.9.2/csv.rb:1330:inopen
from /usr/local/lib/ruby/1.9.2/csv.rb:1395:in read' from csv_block.rb:7:in


#2

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message Re: [ruby-dev:38118] CSV.reade$B$G%V%m%C%/e(B
on Tue, 3 Mar 2009 14:45:40 +0900, madoka yamamoto
removed_email_address@domain.invalid writes:

|trunke$B$Ge(BCSVe$B$GF|K\8l$N%U%!%$%k$rFI$9~$b$&$H$7$?$H$3$m!"e(B
|e$B%V%m%C%/$7$F$7$^$&8=>]$r$
$D$1$^$7$?!#e(B
|
|e$B>:Y$ODI$$$+$1$F$$$J$$$N$G$9$,!"e(B
|1024e$B%P%$%H0J>e$N%G!<%?$rFI$_9~$`:]$K!"e(B
|e$B%(%s%3!<%I<~$j$r860x$H$7$?e(B
|e$BL58B%j%H%i%$$K$J$C$F$$$k$h$&$G$9!#e(B

trunke$B$Ne(Bcsve$B$N%a%s%F%J$O%"%a%j%+?M$G$9$N$G!2DG=$G$$l$Pe(B
ruby-coree$B$+K?M$KD>@%a!<%k$G%l%]!<%H$7$F$$$?$@$1$k$H=u$+$je(B
e$B$^$9!#Fq$7$$$h$&$G$7$?$i!"$*<jEA$$$O$G$-$k$H;W$$$^$9$,!#e(B


#3

e$B;3K$G$9!#e(B

2009/03/03 15:25 Yukihiro M. removed_email_address@domain.invalid:

trunke$B$Ne(Bcsve$B$N%a%s%F%J$O%"%a%j%+?M$G$9$N$G!2DG=$G$$l$Pe(B
ruby-coree$B$+K?M$KD>@%a!<%k$G%l%]!<%H$7$F$$$?$@$1$k$H=u$+$je(B
e$B$^$9!#Fq$7$$$h$&$G$7$?$i!"$*<jEA$$$O$G$-$k$H;W$$$^$9$,!#e(B

e$BN;2r$G$9!#e(BJames
Graye$B$5$s$K$,$s$P$C$F%a!<%k$7$F$_$h$&$H;W$$$^$9!#e(B