function raw_ts = plxtxt2mat(fileToRead1)
%IMPORTFILE(FILETOREAD1)
%  Imports data from the specified file
%  FILETOREAD1:  file to read

%  Auto-generated by MATLAB on 16-Jul-2010 23:21:40

DELIMITER = '\t';
HEADERLINES = 153;

% Import the file
newData1 = importdata(fileToRead1, DELIMITER, HEADERLINES);

disp('newData imported....');

% Create new variables in the base workspace from those fields.
vars = fieldnames(newData1);

for i = 1:length(vars)
    eval([vars{i} ' = newData1.(vars{' num2str(i) '});']);
end

% put the raw data out into the workspace
assignin('base','plxtxt2mat_rawdata',data);

disp(['Size of data matrix = ' ]);
disp(size(data));

for chan = unique(data(:,1))'
    disp(['Working on channel: ' num2str(chan)]);
    for unit = unique(data(find(data(:,1)==chan),2))'
        disp(['   Unit: ' num2str(unit)]);
        raw_ts{1,1}{chan,unit+1} = data(find(data(:,1)==chan & data(:,2)==unit),5);
    end
end

