From: Maria Cieslewski on
Hi,

I am trying to use the matlab function "dlmwrite" to write a string to a csv file. I do not want it to erase the entire csv file, I just want it to input what i told it to, where I told it to without affecting the rest of the file. Does anyone know if it is possible with the dlmwrite function?

Thanks,

M
From: M Chez on
Also, in the dlmwrite.m file, i tried changing the permissions in the fid=fopen(filename,'Wb'); to 'r+' for reading and writing allowances, but without erasing the entire contents, and it does what I want it to do minus the fact that it moves the information already in the csv file the same (x,y) distances that what I am writing to it does already
From: Ashish Uthama on
On Tue, 02 Feb 2010 15:32:02 -0500, Maria Cieslewski
<mcieslewski(a)gmail.com> wrote:

> Hi,
>
> I am trying to use the matlab function "dlmwrite" to write a string to a
> csv file. I do not want it to erase the entire csv file, I just want it
> to input what i told it to, where I told it to without affecting the
> rest of the file. Does anyone know if it is possible with the dlmwrite
> function?
>
> Thanks,
>
> M

Look at the help for the '-append' option.

As to 'where I told it to', you can only append, that is, add data to the
end of a file. If you want to insert data between existing records in the
file, you would to either write to another file or read in the existing
contents to memory, modify and then write it back.