From: Julio Capote Date: 2006-09-09T12:58:05+09:00 Subject: Re: Parsing a tab delimited file with ruby csv? Cory Chamblin wrote: > On 9/8/06, Julio Capote wrote: >> ... I'd >> really appricieate it if someone can post a link to a tutorial or a >> quick code sample detailing how to tell csv to use tabs as a delimiter. > > I have never used it prior to trying this for you (so YMMV), but > (AFAICT) if you need to use the CSV library included with Ruby, the > third parameter in CSV#open is the delimiter, e.g.: > > CSV.open('whatever.csv','r',"\t").each do |field| > puts field > end > > Hope this helps, > Cory I was also wondering if I could throw CSV.open an object instead of a file, for instance, I get my csv file from another site using open-uri: open(url) do |file| @body = file.read end -- Posted via http://www.ruby-forum.com/.