Importing Text based on character column integer

조회 수: 10 (최근 30일)
Nikolay Rodionov
Nikolay Rodionov 2012년 12월 6일
Hi all,
I am trying to import a PDB file into a cell array, but I cannot use textscan() because some of the text columns are so full that the space that normally delimits data is gone.
For an example of my data style look at the ATOM section here: http://en.wikipedia.org/wiki/Protein_Data_Bank_(file_format)
What is an alternative function that I can use break my rows of text by the column they are in?
For example, if I wanted to break the phrase "the brown quick fox jumped over a lazy dog" by columns 1:6, 7:10, 11: then I would get...
[the br] [own] [ quick fox jumped over a lazy dog]
THANKS!

채택된 답변

Walter Roberson
Walter Roberson 2012년 12월 6일
Sample:
textscan('the brown quick fox jumped over a lazy dog','%6s%3s%s', 'Delimiter', '')

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Type Conversion에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by