function  [StocksDataBase, HaghTaghadom, OtherDataBase,MarketData] = Go_Grab_Datafrom(Data_Path)
%% Extract Data Out of Files

[Products,SymProducts] = getAllFiles(Data_Path);
SymProducts1 = SymProducts;
SymProducts1(SymProducts== ' ') = '_';
SymProducts1(SymProducts== '.') = '_';
SymProducts1(SymProducts== '-') = '_';


MarketData = struct;

for ii= 1:size(Products,1)

     FieldValue = importfile_Tse( Products(ii,:));

     
    name = SymProducts1(ii,:);
    name(name=='_') =[];
    name(end-2:end) =[];
    
    MarketData(ii,1).Name =name; 

    MarketData(ii).AllData    = FieldValue;
    MarketData(ii,1).FullName =  SymProducts1(ii,:);

end


%% Categorize

Names ={MarketData.FullName};

Haghtagh = strfind(Names,'_R_csv');
rr = 1;
Others{rr} = strfind(Names,'IFB');    rr =rr+1;
Others{rr} = strfind(Names,'EMobin'); rr =rr+1;
Others{rr} = strfind(Names,'FOHZ'); rr =rr+1;
Others{rr} = strfind(Names,'IKCO'); rr =rr+1;
Others{rr} = strfind(Names,'Index'); rr =rr+1;
Others{rr} = strfind(Names,'Int.'); rr =rr+1;
Others{rr} = strfind(Names,'Inv.'); rr =rr+1;
Others{rr} = strfind(Names,'Mortgage'); rr =rr+1;
Others{rr} = strfind(Names,'SOV.'); rr =rr+1;
Others{rr} = strfind(Names,'SSI-IJR3'); rr =rr+1;
Others{rr} = strfind(Names,'TB11-'); rr =rr+1;
Others{rr} = strfind(Names,'TreasuryBill'); rr =rr+1;
Others{rr} = strfind(Names,'SSI_I'); rr =rr+1;
Others{rr} = strfind(Names,'SOV_M'); rr =rr+1;
Others{rr} = strfind(Names,'Sokuk'); rr =rr+1;
Others{rr} = strfind(Names,'Sukuk'); rr =rr+1;
Others{rr} = strfind(Names,'TB11');



jj = 1;
for kk=1:length(Names)

        for tt=1: numel(Others)
            
             if ~isempty( Others{1, tt}{kk})
                    othersData(kk) = kk; %#ok<AGROW>
                    jj = jj+1;
             end
        end
end
othersData1 = find(othersData); 
% sum([Others{:}])

ii =1;
jj =1;
tt =1;
for kk=1:length(Names)
    
    if ~isempty( Haghtagh{kk})
          HaghTaghadom(ii,1) = MarketData(kk); %#ok<AGROW>
          ii = ii+1;
      
    elseif ismember(kk,othersData1)
            OtherDataBase(jj,1) = MarketData(kk,:); 
            jj = jj+1;
    else
            StocksDataBase(tt,1) = MarketData(kk,:); 
            tt = tt+1;
    end

end




end

