How to import specific column from multiple ASCII files (543 files, .dat format) where each ASCII files are having 14 columns in it.
조회 수: 7 (최근 30일)
이전 댓글 표시
Things to be noted that, the name of ASCII files are random text.
댓글 수: 0
답변 (1개)
Adithya Addanki
2016년 1월 11일
Hi Ankit,
I understand that you are trying to import specific columns from multiple files. You may make use of the import data tool in MATLAB and generate script for use with multiple files.
To do this, you will need to press Import Data(under "Home" tab)-> Select a sample file-> then select the specific columns of interest-> Import Selection-> Generate Script
This action will generate a script for importing the columns from a specific file. Now, you may edit this script to automatically find the files with DAT extension in a particular directory and pass the names of files instead of hardcoded file name in the script.
For instance: t = dir('*.dat') % gives you list of dat files t(1) % struct of the attributes of first file t(2) % struct of the attributes of second file
I hope this helps.
Thank you,
Adithya
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Standard File Formats에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!