help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: the simplest method to write text in a file


From: Richardson, Anthony
Subject: Re: the simplest method to write text in a file
Date: Fri, 15 Mar 2019 10:44:11 +0000

Looks like a line-ending issue.  Windows and Linux use different control codes at the end of lines in text files ( carriage-control and newline  vs just newline).  There are utilities to do the conversion (dos2unix, unix2dos) or editors that support both file types.  Ideally this should not be an issue is the file is created (I text mode) on the same machine on which it is viewed.
Tony Richardson

Get Outlook for Android


From: Help-octave <help-octave-bounces+address@hidden> on behalf of Uwe Damm <address@hidden>
Sent: Friday, March 15, 2019 12:08:23 AM
To: address@hidden
Subject: Re: the simplest method to write text in a file
 

Am 15.03.19 um 00:41 schrieb shivax:
> hi,
> i've a little problem
>
> i have two pc
>
> i write this code:
>
> filename="Predator.log";
> fid = fopen(filename, "w");
>
> fprintf(fid,"Starting Date : %s \n",datestr(StartingDate,20));
> fprintf(fid,"Finishing Date %s \n",datestr(FinishingDate,20));
> fprintf(fid,"Start Procession Date %s \n",datestr(StartingProcessDate,20));
> fprintf(fid,"ReportFolder : %s - OutputFolder %s
> \n",ReportFolder,OutputFolder);
> fclose(fid);
>
> In the first pc i see  all strings on one line
> (https://gyazo.com/a5d08eecdc31a9765a7da0d5324f70e4)
>
> in the second pc I see all the strings correctly in several
> rows(https://gyazo.com/277dbd9921d27f036a9e062069d773ee)
>
> use in both versions 4.4.1
>
> can anyone explain me the reason? txk
>
>
>
>
>
>
> --
> Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html
>
> \n us return key in unix world
>
> replace it by \n\r
>
> Uwe
>
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]