How to import specific column from multiple ASCII files (543 files, .dat format) where each ASCII files are having 14 columns in it.
3 次查看(过去 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 中查找有关 Text Files 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!