Login  Register

Re: Differences in Tab Delimited files between PCs and Macs

Posted by Robert Baer on Jun 29, 2010; 7:44pm
URL: http://imagej.273.s1.nabble.com/Differences-in-Tab-Delimited-files-between-PCs-and-Macs-tp3687786p3687787.html

I don't know if this is the problem or not, but  the termination character
is different on windows and mac.  Windows uses CRLF whereas mac use only LF
(I think).

I'm not sure how IJ.append handles line termination, but what happens if you
explicitly supply "\n" at the end of each line?  The worst that should
happen is you would get interspersed blank lines.

Rob

----- Original Message -----
From: "Kevin Hallock" <[hidden email]>
To: <[hidden email]>
Sent: Tuesday, June 29, 2010 12:45 PM
Subject: Differences in Tab Delimited files between PCs and Macs


Hi,

    I'm developing a program that needs to function on both Macs and PCs.
My current problem is that I'm creating a file for Excel to open, but the
format is only correct on a PC.

    I'm appending the following string:

    String HemoTotalString = StudentNames + "\t" + HemoAStr + "\t" +
HemoSStr + "\t" + HemoFStr + "\t" + "Date: " + ExptDate + "\t" + "Time: " +
ExptTime;

   to a file using the following command:

   IJ.append(HemoTotalString, SavingPath+TodayTeachFileName+".xls");

   When I open the file on a PC, it opens fine with each string in their
individual rows, but on a Mac, the separation is messed up or non-existent.

    Any suggestions?

Thanks,

Kevin

----------------------------------------------
Dr. Kevin Hallock
Boston University School of Medicine
Phone: 617-414-2333
Fax: 617-414-2316
Email: [hidden email]