import file with both text and numbers using texscan
이전 댓글 표시
Hi,
I am trying to import a .txt file (actually many files) that has 2 header lines, and then a combination and text and numbers. I actually don't care about the header lines. What I do care for are the single number after the S (i.e. the Description), and the following number (Position)
I tried using textscan and looked at the help and some of the previous posts, however, I can't make it work.
Here some of my code:
fileID = fopen('P35_TMS3_Control_VTX_markers.txt');
C_data0 = textscan(fileID, '%s %s %d8 %f %f %s');
fclose(fileID);
Thanks so much for your Help!!
Here the first few lines of the txt file (There's actually no empty lines, but without pressing enter after each line, this message would have looked strange):
----------------------------------------------------------------------------------------
Sampling rate: 1024Hz, SamplingInterval: 0.9765625ms
Type, Description, Position, Length, Channel
Stimulus, S 3, 5333, 1, All
Stimulus, S 1, 9441, 1, All
Stimulus, S 3, 12526, 1, All
Stimulus, S 2, 15610, 1, All
Stimulus, S 3, 24140, 1, All
Stimulus, S 2, 27934, 1, All
Stimulus, S 3, 31019, 1, All
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Characters and Strings에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!