Writing a commented output to file

Rob Mahurin rob at utk.edu
Tue May 5 09:46:15 CDT 2009


On May 5, 2009, at 7:55 AM, AlexG1 wrote:
> The problem is this - if I'm using save to write the matrix first I  
> can't
> prepend the comments since there is no way to open a file for  
> prepending but
> only for appending.
> If I write the comments first and then call save -ascii it just  
> overwrites
> the contents of the output file and the file will only contain the  
> matrix
> without the comments.
>
> Any ideas on how I can get both without just using printf() for  
> everything?


comment = sprintf(...);
save -text somefile comment data

Cheers,
Rob

-- 
Rob Mahurin
Department of Physics and Astronomy
University of Tennessee 		865 207 2594
Knoxville, TN 37996 			rob at utk.edu





More information about the Help-octave mailing list