hi guys , i want to read a text file line by line and remove the lines which have NA and the duplicated columns
1 回表示 (過去 30 日間)
古いコメントを表示
d = fopen('COADREAD_methylation.txt','r');
this_line=0;
all={};
while this_line~=-1
% C= textscan( d, '%f%s' ) ;
this_line=fgetl(d);
if this_line~=-1
all=[all;this_line];
end
end
fclose(d);
1 件のコメント
採用された回答
dpb
2017 年 2 月 15 日
編集済み: dpb
2017 年 2 月 16 日
Well, 'NA' is easy, not sure what defines the repeated columns; not enough time at present to try to parse that input file to figure out what is/isn't unique without a description being supplied...
fid = fopen('COADREAD_methylation.txt','r');
data={};
while ~feof(fid)
l=fgetl(fid);
if isempty(strfind(l,'NA')), data=[data;{l}]; end
end
fid=fclose(fid);
If the presence of 'NA' is all that's needed to get all the offending records, then you're done; otherwise need more details on how to tell so folks here don't have to try to work it out on their own.
13 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Large Files and Big Data についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!