Reading .dbf files in a for loop by dynamically changing file names
9 views (last 30 days)
Show older comments
Hi All,
I need to read multiple (175) .dbf files in a for loop. But file name to be read needs to be dynamically changed. File name changes from polyzone1_1.dbf, polyzone1_2.dbf....polyzone1_175.dbf. The sheet name also needs to be dynamically changed, accordingly.
for i=1:175
data{i}=xlsread('<path>\polyzone1_1.dbf','polyzone1_1','A2:A10')
end
Can somebody suggest me a method or help me to complete the code?
Thanks in advance.
0 Comments
Accepted Answer
per isakson
on 23 Oct 2014
Edited: per isakson
on 23 Oct 2014
Replace
polyzone1_1.dbf
by
sprintf('polyzone1_%i.dbf', i )
and
'polyzone1_1'
by
sprintf('polyzone1_%i', i )
 
More Answers (0)
See Also
Categories
Find more on Migrate GUIDE Apps in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!