Re: to tidy my file



Thus spake <Bin Jiang>:

> HI, PB,
>
> this is exacttly the code I tried. I double checked again, by doing
> search. The file outputold.txt is located at c:\MATLAB701\work. But I
> have all my files including a short m file located at c:\SSR, and
> have it in the path setting as well, FILE/Set Path. I expected the
> output file should be under c:\SSR, but why under c:\MATLAB701\work,
> any advice? appreciated.
>
>> All this confusion about fwrite and fprintf is my fault,
>> sorry. You can´t use fwrite to write this, use fprintf. The
>> only thing you have to do is:
>>
>> [name,c]=textread('inputold.txt','%s%c%*s','delimiter',',-');
>> fid=fopen('outputold.txt','wt');
>> for n=1:2:length(c)
>> fprintf(fid,'%s %s.\n',name{n},c(n))
>> end
>> fclose(fid);
>>
>> HTH
>>
>> PB
>>
>> --
>> A: Because it messes up the order in which people normally
>> read text.
>> Q: Why is top-posting such a bad thing?
>> A: Top-posting.
>> Q: What is the most annoying thing on usenet and in e-mail?
>>

This gives me a change to promote one of my File Exchange
submissions :) Download pushd, available here:

http://www.mathworks.com/matlabcentral/fileexchange/loadAuthor.do?objectType=author&objectId=1093919

then do this:

pushd('inputold.txt')

< The code showed in previous posts>

popd

If you don´t wan´t to download that file, set the absolute
path to the dir you like to save your files in. Or use cd.

/PB

--
A: Because it messes up the order in which people normally
read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
.



Relevant Pages

  • Re: to tidy my file
    ... >>> HTH ... > This gives me a change to promote one of my File Exchange ... > submissions:) Download pushd, available here: ... Why is top-posting such a bad thing? ...
    (comp.soft-sys.matlab)
  • Re: Top posting vs Bottom posting
    ... Christofer C. Bell wrote: ... there is zero need to provide context. ... > Top-posting. ... Because it messes up the order in which people normally read text. ...
    (Debian-User)
  • Re: How to complain about slow ISP? Checked in mtr
    ... No speed problems. ... Because it messes up the order in which people normally read text. ... Why is top-posting such a bad thing? ... Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org ...
    (Debian-User)
  • Re: vi editor
    ... pastes the data at the end of the file you are editing. ... pastes it after line containing pattern ... Because it messes up the order in which people normally read text. ... Why is top-posting a bad thing? ...
    (Fedora)
  • Re: to tidy my file
    ... have it in the path setting as well, ... You can´t use fwrite to write this, use fprintf. ... Why is top-posting such a bad thing? ...
    (comp.soft-sys.matlab)