This question is closed. Reopen it to edit or answer.
impport ia txt file into matlab
1 view (last 30 days)
*I have a file in text and I want to sort its information into a xls file the text file is as follows which each part starts with BEGIN IONS and end with END IONS *
*and I want to save it as follows in a xls file *
TITLE PEPMASS RTINSECONDS CHARGE
445.1185_908.046 445.1185 908.046 1 355.074005126953 543 223.07470703125 59 150.026992797852 97
610.1826_-1 610.1826 -1 1
536.1563_-1 536.1563 -1 1
Walter Roberson on 17 Jan 2013
read the file as a single string using fileread(). Use regexp() with named tokens to extract the desired information. Create a cell array from the resulting structure array. xlswrite() the cell array.