I have an application that needs to build a tsv file from a data file that has a couple hundred million rows.
Right now my code to build the tsv file looks something like this:
File.open(data, 'rb').each { |line|
row = to_tsv_row(line)) # this formats the row to be delimited by a tab
open(tsv_path, "a+") { |f| f << row }
}
This seems like it will be a rather slow way to build a tsv file (perhaps inefficient). Is there a library out there that could do this quickly and efficiently?