I have two cell arrays one called info{} and the other is called data{} I am reading information in from a text file and am putting the lines into the info{} cell array. When the program finds a blank line I want to to start over with a new info{} cell array and keep inserting the lines until it find another blank line...
global data
global tags
tags{}
data = {};
line = fgets(fid);
counter = 1;
while ischar(line)
if regexp(line,'/locus_tag=','match','once')
tags{end+1} = line;
else
info{counter} = line;
if strcmp(newline, line)
data{end+1} = info;
info{counter+1}{end+1} = line;
end
end
line = fgets(fid);
end end
I have included some code it doesn't work but it is what I have gotten so far.I think I think I understand the algorithm I need to use to do this but am having some trouble implementing it. Any ideas?
In the end I want something that looks like
data = { {info1} {info2} {info3}... {infon}