[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: fgetl() on Windows
From: |
Bob Odom |
Subject: |
Re: fgetl() on Windows |
Date: |
Mon, 11 May 2009 11:05:45 -0700 (PDT) |
Hi Alex,
You can get rid of the <cr> at the end of the line using:
dos2unix file.in file.out
If you don't have access to a Unix or Linux system, there may be a
Windows version of that function. If you know anyone with a Linux or
Unix system they will have the proper function and can easily do it for
you.
Also there is a complementary function: unix2dos which adds the <cr> and
linefeed to the end of every line.
Bob
On Mon, 11 May 2009, AlexG1 wrote:
Hello,
I'm having some trouble using the fgetl() function on a Windows system.
Every line in a Windows file ends with <cr><lf>. While fgetl() ignores the
<lf> character it doesn't ignore <cr> (unlike the Matlab version of the same
function), which can be problematic in some cases (e.g. when I'm reading a
file path and then try to use fopen() on it - I get fid = -1).
Is there a function which ignores <cr> completely, or should I shorten every
line that is read by 1 character?
Thanks,
Alex
--
View this message in context:
http://www.nabble.com/fgetl%28%29-on-Windows-tp23483929p23483929.html
Sent from the Octave - General mailing list archive at Nabble.com.
_______________________________________________
Help-octave mailing list
address@hidden
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave