我是一个完整的编程初学者,试图学习MATLAB.我想从一堆不同的xml文件中提取数值数据.数字数据项由标签和边界限定.如何在MATLAB中编写程序?
我的算法:
1. Open the folder
2. Look into each of 50 xml files, one at a time
3. Where the tag <HNB.1></HNB.1> exists, copy numerical contents between said tag and write results into a new file
4. The new file name given for step 3 should be the same as the initial file name read in Step 2, being appended with "_data extracted"
Run Code Online (Sandbox Code Playgroud)
例:
FileName = Stewart.xml
Contents = blah blah blah <HNB.1>2</HNB.1> blah blah
NewFileName = Stewart_data extracted.txt …Run Code Online (Sandbox Code Playgroud)