1
1
I have a large .xls file with 53760 rows and 19 columns. I saved it as Tab Delimited Text in order to pre-process it through command line tools and load it into R later. However, when I run
head myfile.txt
my terminal shows all lines at once, like the
cat myfile.txt
command is supposed to do. But if I run
cat myfile.txt | wc -l
the answer I get is 0. More interestingly, R can read my data, without the aid of any extra package, and identify all 53760 rows and 19 columns. I suppose it is an Excel problem, but I can't figure out what is it.
I'm using Mac OS 10.9.1, Microsoft Excel for Mac 2011, bash 4.2 and iTerm 2 1.0.0.20130622
2IIRC then both head and wc count lines and need their expected end of line marker. That marker is sadly different for different systems (e.g. unix, windows and thge older apple OS (the one before OS X) used \10, \10\13 and \13 as codes (newline and return combinations). Can you check which format is in your file? – Hennes – 2014-01-09T11:59:25.020
Your suggestion made sense. I changed from Excel to LibreOffice, exported my file as .csv and it is working now. Thanks! – Marcus Nunes – 2014-01-09T12:16:58.453