Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Delete single line using textscan
Date: Wed, 24 Sep 2008 02:19:01 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 38
Message-ID: <gbc82l$l2d$1@fred.mathworks.com>
References: <g6vscv$91j$1@fred.mathworks.com> <g6vt5k$mi8$1@canopus.cc.umanitoba.ca> <g712in$mf2$1@fred.mathworks.com> <g7139v$8mp$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1222222741 21581 172.30.248.35 (24 Sep 2008 02:19:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 24 Sep 2008 02:19:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1248302
Xref: news.mathworks.com comp.soft-sys.matlab:491689


"AHMET ANIL DINDAR" <adindar@iku.edu.tr> wrote in message <g7139v$8mp$1@fred.mathworks.com>...
> Correction to my code
> say the file (ahmet.txt) includes the following lines 
> 
> ahmet an&#305;l dindar
> 10 20 30 40 
> 10 20 30 40 
> 10 20 30 40 
> end
> 
> the script for deletion the alphabetic lines is 
> 
> %%%--------------------- START %%%%%%%%%%
> fid=fopen('ahmet.txt') ; % the original file
> fidd=fopen('new filename.dat','w') ; % the new file
> while ~feof(fid) ; % reads the original till last line
>   tline=fgets(fid) ;  % 
>      if isletter(tline(1))==1 ;
>      else
>        fwrite(fidd,tline) ;
>      end
> end
> fclose all ;
> %%% -------------------END %%%%%%%%%%%%%%
> 
> the new file includes
> 
> 10 20 30 40 
> 10 20 30 40 
> 10 20 30 40 
> 
> I tested it and it worked.
> 
> AAD


AAD,
GREAT JOB, thank you. This is exactly what I was looking for.