content = fileread('mwithin21rm.txt');linestocopy = regexp(content, '^([^|]*\|){5}~\|.*$', 'match', 'dotexceptnewline', 'lineanchors');newfile = fopen('m21rmmorphU.txt', 'wt');fprintf(newfile, strjoin(linestocopy, '\n'));fclose(newfile);
I need to remove the '~' in column 4 from each line of the text file. The code above moves those lines into a new text file, but I need to eliminate those lines instead. I have attached the file, mwithin21rm.txt.
Best Answer