Hi,
I am trying to read in a text file (of non-uniform format) and trying to extract a specific set of words.
When I have matlab print out the variables in the command window, I see the words are delimited by some character but I dont know what that is.
The delimiter looks like a square box and I tried searching and could not find what it is.
Does anyone know this is? and/or how to use it as a delimiting character? The word I am interested in is 'Arpeggiated'
I have attached my .txt file and the code is below. The text should show up in the command window.
Edit – I thought by saving the string to a new .txt file, I would be able to see the delimiter. This did not work either. There is no longer any space or delimiter between my words.
% input file
infile = '/Volumes/data/downloads/ARP Bells.txt';% open file using fscanf
fid = fopen(infile,'r');txt = fscanf(fid,'%s');fclose(fid);% first filter based on a specific string
ind = strfind(txt,'Aiyn'); % get index location
txt = txt(ind:end);% second filter based on specific delimiter
tok = strtok(txt,'%');% what is the square delimiter symbol?
tok = tok(230:end)% save to see the symbol but doest show up in output
outfile = strrep(infile,'.smpr','_fixed.txt');dlmwrite(outfile,tok,'delimiter','');
Best Answer