Hi Rudolph,

I used TextEdit. On a Mac with OS version earlier than OS10.6
this problem didn't occur. With TextEdit it is not possible to save
as UNIX format.
Thanks for the trick to use sed.

Ed

On 9 Nov 2011, at 15:27, Rudolph Pienaar wrote:

On 11/9/11 07:59 , Ed Gronenschild wrote:
After editing a text file holding the b vecs to be supplied
as input to dt_recon this tool did not interpret the text
file correctly. It turned out that dt_recon did not recognise
the end-of line character in this file: this was decimal
code 13 (called "CR"). It seems that dt_recon only
accepts decimal code 10 (called "LF").
Is it possible to change dt_recon?


What did you use to edit the b-vec file? Different operating systems use different end-of-line (EOL) conventions on text files:

Windows: <cr><lf>
"Old"-style (and largely depreciated) Mac: <cr>
Unix (including Mac and Linux): <lf>

My guess is that you might have used a (possibly old) Mac-based editor to edit your file. Often such editors have the option to save as "UNIX" format. Choose that.

It's not necessary to change 'dt_recon'. Simply convert your old-style Mac <cr> text file to a new style <lf> file with:

  sed s/x0d/x0a/ old-b-vec-file > new-b-vec-file
This replaces the '0x0d' (10 in hex) characters in the file with '0x0a' (13 in hex).

For more details, see: http://www.peterbenjamin.com/seminars/crossplatform/texteol.html



-- 
Rudolph Pienaar, M.Eng, D.Eng / email: rudolph@nmr.mgh.harvard.edu
MGH/MIT/HMS Athinoula A. Martinos Center for Biomedical Imaging
149 (2301) 13th Street, Charlestown, MA 02129 USA


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.