From: Paul Lutus Date: 2006-09-09T11:45:14+09:00 Subject: Re: Parsing a tab delimited file with ruby csv? Julio Capote wrote: > I've been scouring the internet for hours looking for a good tutorial on > how to parse a tab delimited file with ruby's CSV library, the most I > know is that the library does in fact support tabs as the delimiter, 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. For a case like this, there's really no point using the CSV library. If tabs are used exclusively as delimiters and do not appear in the data, and if each line is terminated with a linefeed, parsing such a file is very, very easy with Ruby. File.open("filename").each do |record| record.split("\t").each do |field| field.chomp! # do something here with each field end end > Thanks! Any time. :) -- Paul Lutus http://www.arachnoid.com