0

I have a Perl script that I wrote and ran in windows that reads the contents of a .xls file using Spreadsheet::ParseExcel. When I transfer the xls file and the perl script over to a linux server to run it, it can't read any of the data in the xls file.

I've created an xls file on the linux server using Spreadsheet::WriteExcel and then once it creates a file I can read it in with my other script that uses parse. So essentially if it's created on linux it works, however I can't create a spreadsheet in windows and then drag it over and parse it in linux.

Seems to be some kind of format issue but I'm wondering if there are any workarounds?

yankees13
  • 125
  • 5
  • Do the [line](http://www.cs.toronto.edu/~krueger/csc209h/tut/line-endings.html) [endings](http://stackoverflow.com/questions/1279779/what-is-the-difference-between-r-and-n) matter? – summea Apr 08 '14 at 17:34
  • I tried running dos2unix on the file but it didn't help. – yankees13 Apr 08 '14 at 17:36
  • dos2unix is unnecessary. I presume you are transferring the files intact (i.e. binary mode). Does the process work the other way round, i.e. a file created with WriteExcel in Linux is readable by ParseExcel in Windows? – imran Apr 08 '14 at 18:57
  • "transfer", how? File sizes are the same on all systems? Not getting corrupted (line ending conversions) enywhere? – runrig Apr 08 '14 at 20:11
  • It works now. I had tried so many different things and ended up uncommenting something that shouldn't have been. Stupid mistake. – yankees13 Apr 08 '14 at 20:29
  • @stuter12 Include your solution (even stupid mistake) as an answer so that the question can be closed. – Miller Apr 09 '14 at 02:22

1 Answers1

0

It works now. I had tried so many different things and ended up uncommenting something that shouldn't have been. Stupid mistake.

yankees13
  • 125
  • 5