The following code uses regexp to extract the data you want. You can play around with the expression here . data = fileread('00000090Head.txt');
expression = '(?<=WAV;\s*)(\d*)(?:;\s*\d*;\d;\d;(.*?(?=;));\s*\d*\.\d*;\s*)(-?\d*)';
[tokens,match] = regexp(data,expression,'tokens','match');
sampleFrequency = cellfun(@(x) x(1,1),tokens);
position = cellfun(@(x) x(1,2),tokens);
Position and sampleFrequency are both 1x183 cell arrays and contain the data you are interested in.
position = {'-10000' '-9000' '-8000' '-7000' '-6000' '-5000' '-4500' '-4000' '-3500' '-3000' ................}
sampleFrequency = {'22000' '22000' '22000' '22000' '22000' '22000' '22000' '22000' '22000' '22000' .................}
Best Answer