DelimitedFiles reading everything in one column

Hi!

I am trying to read a csv file in Julia using readdlm. When I do this, readdlm wraps each row in my csv in a quote, and thus, ignores the \t column delimiters. Each row of the Matrix looks like this:

Matrix =  readdlm("data.csv",'\t')

842752×1 Array{Any,2}:
 "id\tISO3\tlog_tariff2005\tlog_tariff2006\tlog_tariff2007\tlog_tariff2008\tlog_tariff2009\tlog_tariff2010\tlog_tariff2011\tlog_tariff2012\tlog_tariff2013\tlog_tariff2014\tlog_tariff2015\tlog_tariff2016\tlog_tariff2017"
 "2\t\"ABW\"\t.0279394\t.0279394\t.0386549\t.0386549\t.0386549\t.0386549\t.0386549\t.0386549\t.0386549\t.0386549\t.0386549\t.0386549\t.0386549"                                                                            
 "2\t\"AGO\"\t.0279394\t.0279394\t.0386549\t.0386549\t.0386549\t.0386549\t.0386549\t.0386549\t.0386549\t.0386549\t.0386549\t.0386549\t.0386549"                                                                            
 "2\t\"ALB\"\t.0279394\t.0279394\t.0386549\t.0386549\t.0386549\t.0386549\t.0386549\t.0386549\t.0386549\t.0386549\t.0386549\t.0386549\t.0386549"                                                                            
 "2\t\"ARE\"\t.0279394\t.0279394\t.0386549\t.0386549\t.0386549\t.0386549\t.0386549\t.0386549\t.0…

As you can see, readdlm is wrapping each row in a quote, which I believe is what impedes Julia to recognize that these columns are in fact separated by a tabulation.

A MWE example with the contents of a file that produces the issues would be helpful. For me, a file that contains

id	ISO3	log_tariff2005	log_tariff2006
2	ABW	.0279394	.0279394

reads correctly.

2 Likes