I want to delete some lines from a .txt file
    3 Ansichten (letzte 30 Tage)
  
       Ältere Kommentare anzeigen
    
I WANT TO REMOVE LINES WHICH CONTAINS CHARACTERS AND ALPHABETS AND I WANT TO RETAIN ONLY NUMBERS IN A TEXT DOCUMENT USING MATLAB. SOME ONE PLEASE HEP ME IN DOING SO. In the above text file, there are some lines like 'HUMAN DETECTED' 'Animal Detected'. I want to create a new file which contains only numbers and not these lines containing alphabetic messages.
2 Kommentare
Antworten (2)
  Azzi Abdelmalek
      
      
 am 12 Apr. 2016
        line='I want to delete 123  lines from 24 .txt file 0.458 and67.45'
out=regexp(line,'\d+(\.)?\d+','match')
0 Kommentare
  Azzi Abdelmalek
      
      
 am 12 Apr. 2016
        
      Bearbeitet: Azzi Abdelmalek
      
      
 am 12 Apr. 2016
  
      fid=fopen('12-04-16-10-01-16.txt')
M=textscan(fid,repmat('%f ',1,16))
fclose(fid)
out=cell2mat(M)
0 Kommentare
Siehe auch
Kategorien
				Mehr zu Text Files finden Sie in Help Center und File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


