Re: to tidy my file
- From: PB <pbodin@xxxxxxxxxxxxxxxxxxx>
- Date: Tue, 9 Aug 2005 12:16:32 +0200
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?
.
- Follow-Ups:
- Re: to tidy my file
- From: Bin Jiang
- Re: to tidy my file
- References:
- Re: to tidy my file
- From: PB
- Re: to tidy my file
- From: Jérôme
- Re: to tidy my file
- From: PB
- Re: to tidy my file
- From: Bin Jiang
- Re: to tidy my file
- From: PB
- Re: to tidy my file
- From: Bin Jiang
- Re: to tidy my file
- Prev by Date: Re: cftool - axis equal tight
- Next by Date: Re: Varying coefficients in (non)linear regression
- Previous by thread: Re: to tidy my file
- Next by thread: Re: to tidy my file
- Index(es):
Relevant Pages
|