How to read XML files

6 次查看(过去 30 天)
Maura Monville
Maura Monville 2016-12-12
I have a strange XML file. I am not familiar with this format. I need some help at reading the values contained in it. I am attaching an example file. I am interested in the couple of values separated by ",". For instance: d1,v1; d2,v2; ..... ; d_n,v_n I would like to get a vector with all d_i values and another vector with all v_i numbers. I need some help. Example: version="1.0"?
-<BeamDataDocument Version="1.0">
-<BeamData DataTypeId="OPD">
Depth="2.2" FieldSize="100.0" Id="Fs100.0">2.2,64.1;2.4,66.5;2.6,68.6;2.8,70.4;3,72.2;3.2,73.8;3.4,75.4;3.6,76.9;3.8,78.5;4,79.9;4.2,81.3;4.4,82.6;4.6,83.9;4.8,85.1;5,86.2;5.2,87.3;5.4,88.3;5.6,89.2;5.8,90;6,90.8;6.2,91.5;6.4,92.1;6.6,92.6;6.8,93.2;7,93.6;7.2,94.1;7.4,94.4;7.6,94.8;7.8,95.1;8,95.5;8.2,95.8;8.4,96.1;8.6,96.4;8.8,96.7;9,96.9;9.2,97.2;9.4,97.5;9.6,97.7;9.8,98;10,98.2;10.2,98.4;10.4,98.6;10.6,98.8;10.8,99;11,99.2;11.2,99.3;11.4,99.4;11.6,99.5;11.8,99.6;12,99.7;12.2,99.8;12.4,99.8;12.6,99.8;12.8,99.9;13,99.9;13.2,99.9;13.4,99.9;13.6,99.9;13.8,99.9;14,99.9;14.2,99.9;14.4,99.9;14.6,99.9;14.8,99.8;15,99.8;15.2,99.8;15.4,99.8;15.6,99.8;15.8,99.7;16,99.7;16.2,99.6;16.4,99.6;16.6,99.5;16.8,99.5;17,99.4;17.2,99.4;17.4,99.3;17.6,99.3;17.8,99.3;18,99.2;18.2,99.2;18.4,99.1;18.6,99.1;18.8,99;19,99;19.2,98.9;19.4,98.8;19.6,98.8;19.8,98.7;20,98.6;20.2,98.5;20.4,98.4;20.6,98.3;20.8,98.2;21,98.1;21.2,98;21.4,98;21.6,97.9;21.8,97.8;22,97.7;22.2,97.6;22.4,97.6;22.6,97.5;22.8,97.4;23,97.3;23.2,97.3;23.4,97.2;23.6,97.2;23.8,97.2;24,97.1;24.2,97.1;24.4,97.1;24.6,97;24.8,96.9;25,96.9;25.2,96.8;25.4,96.7;25.6,96.6;25.8,96.5;26,96.4;26.2,96.4;26.4,96.3;26.6,96.2;26.8,96.1;27,96;27.2,95.9;27.4,95.8;27.6,95.7;27.8,95.7;28,95.6;28.2,95.5;28.4,95.4;28.6,95.3;28.8,95.2;29,95.1;29.2,95;29.4,94.8;29.6,94.7;29.8,94.6;30,94.5;30.2,94.4;30.4,94.3;30.6,94.2;30.8,94.1;31,94;31.2,93.9;31.4,93.8;31.6,93.7;31.8,93.6;32,93.5;32.2,93.4;32.4,93.4;32.6,93.3;32.8,93.2;33,93.2;33.2,93.1;33.4,93;33.6,93;33.8,92.9;34,92.9;34.2,92.8;34.4,92.8;34.6,92.7;34.8,92.7;35,92.6;35.2,92.6;35.4,92.5;35.6,92.4;35.8,92.3;36,92.2;36.2,92.1;36.4,91.9;36.6,91.8;36.8,91.7;37,91.6;37.2,91.5;37.4,91.4;37.6,91.3;37.8,91.3;38,91.2;38.2,91.2;38.4,91.1;38.6,91;38.8,90.9;39,90.8;39.2,90.7;39.4,90.6;39.6,90.5;39.8,90.4;40,90.3;40.2,90.2;40.4,90.1;40.6,90;40.8,89.9;41,89.8;41.2,89.7;41.4,89.6;41.6,89.5;41.8,89.4;42,89.3;42.2,89.2;42.4,89.1;42.6,89.1;42.8,89;43,88.9;43.2,88.9;43.4,88.8;43.6,88.8;43.8,88.7;44,88.6;44.2,88.5;44.4,88.4;44.6,88.3;44.8,88.2;45,88.1;45.2,88;45.4,88;45.6,87.9;45.8,87.8;46,87.7;46.2,87.6;46.4,87.5;46.6,87.5;46.8,87.4;47,87.3;47.2,87.2;47.4,87.2;47.6,87.1;47.8,87;48,87;48.2,86.9;48.4,86.8;48.6,86.8;48.8,86.7;49,86.6;49.2,86.5;49.4,86.4;49.6,86.3;49.8,86.2;50,86.1;50.2,86;50.4,85.9;50.6,85.8;50.8,85.7;51,85.6;51.2,85.5;51.4,85.4;51.6,85.4;51.8,85.3;52,85.3;52.2,85.2;52.4,85.2;52.6,85.1;52.8,85.1;53,85;53.2,84.9;53.4,84.8;53.6,84.7;53.8,84.6;54,84.5;54.2,84.5;54.4,84.4;54.6,84.3;54.8,84.2;55,84.1;55.2,84.1;55.4,84;55.6,83.9;55.8,83.8;56,83.8;56.2,83.7;56.4,83.6;56.6,83.5;56.8,83.4;57,83.3;57.2,83.2;57.4,83.1;57.6,83;57.8,82.9;58,82.8;58.2,82.7;58.4,82.6;58.6,82.5;58.8,82.4;59,82.3;59.2,82.2;59.4,82.1;59.6,82;59.8,81.9;60,81.9;60.2,81.8;60.4,81.7;60.6,81.7;60.8,81.6;61,81.6;61.2,81.5;61.4,81.5;61.6,81.4;61.8,81.3;62,81.2;62.2,81.1;62.4,81;62.6,80.9;62.8,80.8;63,80.7;63.2,80.6;63.4,80.5;63.6,80.4;63.8,80.3;64,80.2;64.2,80.1;64.4,80.1;64.6,80;64.8,79.9;65,79.9;65.2,79.8;65.4,79.7;65.6,79.6;65.8,79.5;66,79.4;66.2,79.4;66.4,79.3;66.6,79.2;66.8,79.1;67,79;67.2,79;67.4,78.9;67.6,78.8;67.8,78.8;68,78.7;68.2,78.6;68.4,78.5;68.6,78.4;68.8,78.3;69,78.2;69.2,78.1;69.4,78;69.6,77.9;69.8,77.9;70,77.8;70.2,77.7;70.4,77.7;70.6,77.6;70.8,77.6;71,77.5;71.2,77.5;71.4,77.4;71.6,77.3;71.8,77.2;72,77.1;72.2,77;72.4,76.9;72.6,76.8;72.8,76.7;73,76.7;73.2,76.6;73.4,76.5;73.6,76.4;73.8,76.3;74,76.2;74.2,76.2;74.4,76.1;74.6,76;74.8,75.9;75,75.8;75.2,75.7;75.4,75.7;75.6,75.6;75.8,75.5;76,75.5;76.2,75.4;76.4,75.4;76.6,75.3;76.8,75.2;77,75.1;77.2,75;77.4,74.9;77.6,74.8;77.8,74.7;78,74.6;78.2,74.5;78.4,74.4;78.6,74.3;78.8,74.2;79,74.2;79.2,74.1;79.4,74.1;79.6,74;79.8,74;80,74;80.2,73.9;80.4,73.9;80.6,73.8;80.8,73.7;81,73.7;81.2,73.6;81.4,73.5;81.6,73.5;81.8,73.4;82,73.3;82.2,73.2;82.4,73.1;82.6,73.1;82.8,73;83,72.9;83.2,72.8;83.4,72.7;83.6,72.6;83.8,72.5;84,72.4;84.2,72.3;84.4,72.2;84.6,72.2;84.8,72.1;85,72;85.2,72;85.4,71.9;85.6,71.9;85.8,71.8;86,71.7;86.2,71.7;86.4,71.6;86.6,71.6;86.8,71.5;87,71.4;87.2,71.4;87.4,71.3;87.6,71.2;87.8,71.1;88,71;88.2,71;88.4,70.9;88.6,70.8;88.8,70.7;89,70.7;89.2,70.6;89.4,70.6;89.6,70.5;89.8,70.4;90,70.3;90.2,70.3;90.4,70.2;90.6,70.1;90.8,70;91,69.9;91.2,69.8;91.4,69.7;91.6,69.5;91.8,69.4;92,69.3;92.2,69.3;92.4,69.2;92.6,69.1;92.8,69.1;93,69;93.2,69;93.4,68.9;93.6,68.9;93.8,68.8;94,68.8;94.2,68.8;94.4,68.7;94.6,68.6;94.8,68.6;95,68.5;95.2,68.4;95.4,68.3;95.6,68.2;95.8,68.1;96,68;96.2,67.9;96.4,67.8;96.6,67.7;96.8,67.7;97,67.6;97.2,67.5;97.4,67.5;97.6,67.4;97.8,67.3;98,67.3;98.2,67.2;98.4,67.1;98.6,67;98.8,66.9;99,66.8;99.2,66.7;99.4,66.6;99.6,66.6;99.8,66.5;100,66.5;100.2,66.4;100.4,66.4;100.6,66.3;100.8,66.3;101,66.2;101.2,66.1;101.4,66.1;101.6,66;101.8,65.9;102,65.8;102.2,65.7;102.4,65.6;102.6,65.5;102.8,65.4;103,65.3;103.2,65.2;103.4,65.1;103.6,65.1;103.8,65;104,64.9;104.2,64.9;104.4,64.9;104.6,64.8;104.8,64.8;105,64.7;105.2,64.7;105.4,64.6;105.6,64.6;105.8,64.5;106,64.5;106.2,64.4;106.4,64.3;106.6,64.3;106.8,64.2;107,64.1;107.2,64.1;107.4,64;107.6,64;107.8,63.9;108,63.9;108.2,63.8;108.4,63.8;108.6,63.7;108.8,63.6;109,63.5;109.2,63.4;109.4,63.3;109.6,63.2;109.8,63.1;110,63;110.2,62.9;110.4,62.8;110.6,62.7;110.8,62.6;111,62.5;111.2,62.4;111.4,62.4;111.6,62.3;111.8,62.2;112,62.2;112.2,62.1;112.4,62;112.6,62;112.8,61.9;113,61.9;113.2,61.8;113.4,61.8;113.6,61.7;113.8,61.7;114,61.6;114.2,61.6;114.4,61.5;114.6,61.4;114.8,61.4;115,61.3;115.2,61.3;115.4,61.2;115.6,61.2;115.8,61.1;116,61;116.2,61;116.4,60.9;116.6,60.8;116.8,60.8;117,60.7;117.2,60.6;117.4,60.5;117.6,60.5;117.8,60.4;118,60.3;118.2,60.3;118.4,60.2;118.6,60.1;118.8,60.1;119,60;119.2,60;119.4,59.9;119.6,59.9;119.8,59.8;120,59.8;120.2,59.8;120.4,59.7;120.6,59.7;120.8,59.6;121,59.5;121.2,59.5;121.4,59.4;121.6,59.3;121.8,59.2;122,59.2;122.2,59.1;122.4,59;122.6,58.9;122.8,58.9;123,58.8;123.2,58.7;123.4,58.7;123.6,58.6;123.8,58.6;124,58.5;124.2,58.4;124.4,58.3;124.6,58.3;124.8,58.2;125,58.1;125.2,58;125.4,57.9;125.6,57.9;125.8,57.8;126,57.7;126.2,57.6;126.4,57.6;126.6,57.5;126.8,57.5;127,57.4;127.2,57.4;127.4,57.3;127.6,57.3;127.8,57.2;128,57.1;128.2,57;128.4,56.9;128.6,56.9;128.8,56.8;129,56.7;129.2,56.6;129.4,56.6;129.6,56.5;129.8,56.4;130,56.4;130.2,56.3;130.4,56.3;130.6,56.2;130.8,56.2;131,56.1;131.2,56;131.4,56;131.6,55.9;131.8,55.8;132,55.8;132.2,55.7;132.4,55.6;132.6,55.5;132.8,55.5;133,55.4;133.2,55.3;133.4,55.3;133.6,55.2;133.8,55.1;134,55.1;134.2,55;134.4,55;134.6,54.9;134.8,54.9;135,54.8;135.2,54.8;135.4,54.8;135.6,54.7;135.8,54.7;136,54.6;136.2,54.6;136.4,54.5;136.6,54.4;136.8,54.3;137,54.3;137.2,54.2;137.4,54.1;137.6,54.1;137.8,54;138,53.9;138.2,53.9;138.4,53.9;138.6,53.8;138.8,53.8;139,53.7;139.2,53.7;139.4,53.6;139.6,53.5;139.8,53.5;140,53.4;140.2,53.3;140.4,53.3;140.6,53.2;140.8,53.1;141,53.1;141.2,53;141.4,53;141.6,52.9;141.8,52.9;142,52.8;142.2,52.8;142.4,52.7;142.6,52.7;142.8,52.7;143,52.6;143.2,52.6;143.4,52.5;143.6,52.5;143.8,52.4;144,52.3;144.2,52.2;144.4,52.2;144.6,52.1;144.8,52;145,51.9;145.2,51.8;145.4,51.8;145.6,51.7;145.8,51.7;146,51.6;146.2,51.5;146.4,51.5;146.6,51.4;146.8,51.4;147,51.3;147.2,51.3;147.4,51.3;147.6,51.2;147.8,51.1;148,51.1;148.2,51.1;148.4,51;148.6,50.9;148.8,50.9;149,50.8;149.2,50.8;149.4,50.7;149.6,50.7;149.8,50.6;150,50.5;150.2,50.5;150.4,50.4;150.6,50.4;150.8,50.3;151,50.3;151.2,50.2;151.4,50.2;151.6,50.1;151.8,50.1;152,50;152.2,50;152.4,49.9;152.6,49.9;152.8,49.8;153,49.7;153.2,49.7;153.4,49.6;153.6,49.5;153.8,49.4;154,49.4;154.2,49.3;154.4,49.2;154.6,49.2;154.8,49.1;155,49.1;155.2,49;155.4,49;155.6,49;155.8,48.9;156,48.9;156.2,48.8;156.4,48.8;156.6,48.7;156.8,48.7;157,48.6;157.2,48.6;157.4,48.5;157.6,48.4;157.8,48.4;158,48.3;158.2,48.3;158.4,48.2;158.6,48.2;158.8,48.1;159,48.1;159.2,48;159.4,48;159.6,47.9;159.8,47.8;160,47.8;160.2,47.7;160.4,47.7;160.6,47.6;160.8,47.6;161,47.5;161.2,47.5;161.4,47.4;161.6,47.4;161.8,47.3;162,47.3;162.2,47.2;162.4,47.2;162.6,47.1;162.8,47.1;163,47;163.2,47;163.4,46.9;163.6,46.8;163.8,46.7;164,46.7;164.2,46.6;164.4,46.6;164.6,46.5;164.8,46.5;165,46.4;165.2,46.4;165.4,46.3;165.6,46.3;165.8,46.3;166,46.2;166.2,46.2;166.4,46.1;166.6,46;166.8,46;167,45.9;167.2,45.9;167.4,45.8;167.6,45.8;167.8,45.7;168,45.7;168.2,45.6;168.4,45.6;168.6,45.5;168.8,45.5;169,45.5;169.2,45.4;169.4,45.4;169.6,45.3;169.8,45.3;170,45.2;170.2,45.2;170.4,45.1;170.6,45.1;170.8,45;171,44.9;171.2,44.9;171.4,44.8;171.6,44.8;171.8,44.8;172,44.7;172.2,44.7;172.4,44.6;172.6,44.6;172.8,44.5;173,44.5;173.2,44.4;173.4,44.4;173.6,44.3;173.8,44.3;174,44.2;174.2,44.1;174.4,44;174.6,44;174.8,43.9;175,43.8;175.2,43.8;175.4,43.7;175.6,43.7;175.8,43.6;176,43.6;176.2,43.6;176.4,43.5;176.6,43.5;176.8,43.5;177,43.4;177.2,43.4;177.4,43.3;177.6,43.3;177.8,43.2;178,43.2;178.2,43.1;178.4,43.1;178.6,43;178.8,43;179,42.9;179.2,42.9;179.4,42.8;179.6,42.8;179.8,42.7;180,42.7;180.2,42.6;180.4,42.6;180.6,42.6;180.8,42.5;181,42.5;181.2,42.5;181.4,42.5;181.6,42.4;181.8,42.4;182,42.4;182.2,42.3;182.4,42.3;182.6,42.2;182.8,42.2;183,42.1;183.2,42.1;183.4,42;183.6,41.9;183.8,41.8;184,41.8;184.2,41.7;184.4,41.6;184.6,41.6;184.8,41.5;185,41.5;185.2,41.4;185.4,41.4;185.6,41.3;185.8,41.3;186,41.3;186.2,41.3;186.4,41.2;186.6,41.2;186.8,41.2;187,41.2;187.2,41.1;187.4,41.1;187.6,41.1;187.8,41;188,41;188.2,40.9;188.4,40.9;188.6,40.8;188.8,40.8;189,40.7;189.2,40.7;189.4,40.6;189.6,40.6;189.8,40.5;190,40.5;190.2,40.4;190.4,40.4;190.6,40.4;190.8,40.3;191,40.3;191.2,40.2;191.4,40.2;191.6,40.1;191.8,40.1;192,40;192.2,40;192.4,39.9;192.6,39.9;192.8,39.8;193,39.8;193.2,39.7;193.4,39.7;193.6,39.6;193.8,39.6;194,39.5;194.2,39.4;194.4,39.4;194.6,39.3;194.8,39.3;195,39.2;195.2,39.2;195.4,39.1;195.6,39.1;195.8,39.1;196,39;196.2,39;196.4,38.9;196.6,38.9;196.8,38.9;197,38.8;197.2,38.8;197.4,38.7;197.6,38.7;197.8,38.6;198,38.6;198.2,38.5;198.4,38.5;198.6,38.5;198.8,38.4;199,38.4;199.2,38.4;199.4,38.3;199.6,38.3;199.8,38.3;200,38.2;200.2,38.2;200.4,38.1;200.6,38.1;200.8,38.1;201,38;201.2,38;201.4,37.9;201.6,37.9;201.8,37.9;202,37.8;202.2,37.8;202.4,37.7;202.6,37.7;202.8,37.6;203,37.6;203.2,37.6;203.4,37.5;203.6,37.5;203.8,37.5;204,37.4;204.2,37.4;204.4,37.3;204.6,37.3;204.8,37.3;205,37.2;205.2,37.2;205.4,37.1;205.6,37.1;205.8,37;206,37;206.2,36.9;206.4,36.9;206.6,36.8;206.8,36.8;207,36.7;207.2,36.7;207.4,36.6;207.6,36.6;207.8,36.5;208,36.5;208.2,36.4;208.4,36.4;208.6,36.4;208.8,36.3;209,36.3;209.2,36.3;209.4,36.3;209.6,36.2;209.8,36.2;210,36.2;210.2,36.2;210.4,36.1;210.6,36.1;210.8,36.1;211,36;211.2,36;211.4,35.9;211.6,35.9;211.8,35.8;212,35.8;212.2,35.8;212.4,35.7;212.6,35.7;212.8,35.7;213,35.6;213.2,35.6;213.4,35.5;213.6,35.5;213.8,35.4;214,35.4;214.2,35.3;214.4,35.3;214.6,35.2;214.8,35.2;215,35.1;215.2,35.1;215.4,35.1;215.6,35.1;215.8,35.1;216,35;216.2,35;216.4,35;216.6,34.9;216.8,34.9;217,34.8;217.2,34.8;217.4,34.7;217.6,34.6;217.8,34.6;218,34.6;218.2,34.5;218.4,34.5;218.6,34.4;218.8,34.4;219,34.4;219.2,34.3;219.4,34.3;219.6,34.2;219.8,34.2;220,34.1;220.2,34.1;220.4,34;220.6,34;220.8,33.9;221,33.9;221.2,33.9;221.4,33.8;221.6,33.8;221.8,33.8;222,33.7;222.2,33.7;222.4,33.7;222.6,33.6;222.8,33.6;223,33.6;223.2,33.5;223.4,33.5;223.6,33.5;223.8,33.5;224,33.4;224.2,33.4;224.4,33.4;224.6,33.4;224.8,33.3;225,33.3;225.2,33.3;225.4,33.2;225.6,33.2;225.8,33.2;226,33.1;226.2,33.1;226.4,33;226.6,33;226.8,32.9;227,32.9;227.2,32.8;227.4,32.8;227.6,32.7;227.8,32.7;228,32.7;228.2,32.6;228.4,32.6;228.6,32.6;228.8,32.6;229,32.5;229.2,32.5;229.4,32.5;229.6,32.4;229.8,32.4;230,32.4;230.2,32.3;230.4,32.3;230.6,32.3;230.8,32.2;231,32.2;231.2,32.2;231.4,32.1;231.6,32.1;231.8,32;232,32;232.2,31.9;232.4,31.9;232.6,31.8;232.8,31.8;233,31.7;233.2,31.7;233.4,31.7;233.6,31.6;233.8,31.6;234,31.5;234.2,31.5;234.4,31.5;234.6,31.5;234.8,31.4;235,31.4;235.2,31.4;235.4,31.3;235.6,31.3;235.8,31.3;236,31.2;236.2,31.2;236.4,31.2;236.6,31.1;236.8,31.1;237,31.1;237.2,31;237.4,31;237.6,31;237.8,30.9;238,30.9;238.2,30.9;238.4,30.8;238.6,30.8;238.8,30.7;239,30.7;239.2,30.7;239.4,30.6;239.6,30.6;239.8,30.6;240,30.5;240.2,30.5;240.4,30.5;240.6,30.4;240.8,30.4;241,30.4;241.2,30.3;241.4,30.3;241.6,30.2;241.8,30.2;242,30.2;242.2,30.1;242.4,30.1;242.6,30.1;242.8,30;243,30;243.2,30;243.4,30;243.6,30;243.8,29.9;244,29.9;244.2,29.9;244.4,29.9;244.6,29.9;244.8,29.9;245,29.8;245.2,29.8;245.4,29.8;245.6,29.8;245.8,29.7;246,29.7;246.2,29.6;246.4,29.6;246.6,29.5;246.8,29.5;247,29.4;247.2,29.3;247.4,29.3;247.6,29.2;247.8,29.2;248,29.1;248.2,29.1;248.4,29.1;248.6,29.1;248.8,29;249,29;249.2,29;249.4,29;249.6,29;249.8,29;250,28.9;250.2,28.9;250.4,28.9;250.6,28.8;250.8,28.8;251,28.7;251.2,28.7;251.4,28.7;251.6,28.7;251.8,28.6;252,28.6;252.2,28.6;252.4,28.6;252.6,28.6;252.8,28.6;253,28.6;253.2,28.5;253.4,28.5;253.6,28.5;253.8,28.4;254,28.4;254.2,28.3;254.4,28.3;254.6,28.3;254.8,28.2;255,28.2;255.2,28.1;255.4,28.1;255.6,28;255.8,27.9;256,27.9;256.2,27.8;256.4,27.8;256.6,27.7;256.8,27.7;257,27.6;257.2,27.6;257.4,27.6;257.6,27.6;257.8,27.6;258,27.6;258.2,27.5;258.4,27.5;258.6,27.5;258.8,27.5;259,27.5;259.2,27.5;259.4,27.5;259.6,27.5;259.8,27.4;260,27.4;260.2,27.4;260.4,27.3;260.6,27.3;260.8,27.3;261,27.2;261.2,27.2;261.4,27.1;261.6,27.1;261.8,27.1;262,27;262.2,27;262.4,27;262.6,26.9;262.8,26.9;263,26.9;263.2,26.9;263.4,26.8;263.6,26.8;263.8,26.8;264,26.8;264.2,26.7;264.4,26.7;264.6,26.7;264.8,26.6;265,26.6;265.2,26.5;265.4,26.5;265.6,26.4;265.8,26.4;266,26.4;266.2,26.3;266.4,26.3;266.6,26.3;266.8,26.2;267,26.2;267.2,26.2;267.4,26.2;267.6,26.2;267.8,26.2;268,26.1;268.2,26.1;268.4,26;268.6,26;268.8,26;269,25.9;269.2,25.9;269.4,25.9;269.6,25.9;269.8,25.8;270,25.8;270.2,25.8;270.4,25.8;270.6,25.8;270.8,25.8;271,25.8;271.2,25.8;271.4,25.8;271.6,25.8;271.8,25.8;272,25.7;272.2,25.7;272.4,25.7;272.6,25.6;272.8,25.6;273,25.5;273.2,25.5;273.4,25.4;273.6,25.4;273.8,25.3;274,25.3;274.2,25.3;274.4,25.2;274.6,25.2;274.8,25.2;275,25.2;275.2,25.1;275.4,25.1;275.6,25.1;275.8,25.1;276,25.1;276.2,25.1;276.4,25;276.6,25;276.8,25;277,25;277.2,24.9;277.4,24.9;277.6,24.8;277.8,24.8;278,24.7;278.2,24.7;278.4,24.7;278.6,24.6;278.8,24.6;279,24.6;279.2,24.5;279.4,24.5;279.6,24.5;279.8,24.5;280,24.5;280.2,24.4;280.4,24.4;280.6,24.4;280.8,24.4;281,24.3;281.2,24.3;281.4,24.3;281.6,24.3;281.8,24.3;282,24.3;282.2,24.2;282.4,24.2;282.6,24.2;282.8,24.2;283,24.2;283.2,24.1;283.4,24.1;283.6,24;283.8,24;284,23.9;284.2,23.9;284.4,23.8;284.6,23.8;284.8,23.8;285,23.8;285.2,23.7;285.4,23.7;285.6,23.7;285.8,23.7;286,23.7;286.2,23.7;286.4,23.7;286.6,23.6;286.8,23.6;287,23.6;287.2,23.6;287.4,23.5;287.6,23.5;287.8,23.5;288,23.4;288.2,23.4;288.4,23.4;288.6,23.3;288.8,23.3;289,23.3;289.2,23.2;289.4,23.2;289.6,23.2;289.8,23.2;290,23.2;290.2,23.2;290.4,23.1;290.6,23.1;290.8,23.1;291,23.1;291.2,23.1;291.4,23;291.6,23;291.8,22.9;292,22.9;292.2,22.9;292.4,22.8;292.6,22.8;292.8,22.8;293,22.8;293.2,22.7;293.4,22.7;293.6,22.7;293.8,22.6;294,22.6;294.2,22.6;294.4,22.6;294.6,22.5;294.8,22.5;295,22.5;295.2,22.5;295.4,22.5;295.6,22.5;295.8,22.5;296,22.4;296.2,22.4;296.4,22.4;296.6,22.4;296.8,22.4;297,22.3;297.2,22.3;297.4,22.3;297.6,22.3;297.8,22.3;298,22.3;298.2,22.2;298.4,22.2;298.6,22.2;298.8,22.2;299,22.1;299.2,22.1;299.4,22.1;299.6,22.1;299.8,22;300,22;300.2,22;300.4,22;300.6,21.9;300.8,21.9;301,21.9;301.2,21.9;301.4,21.9;301.6,21.8;301.8,21.8;302,21.8;302.2,21.8;302.4,21.7;302.6,21.7;302.8,21.7;303,21.7;303.2,21.6;303.4,21.6;303.6,21.6;303.8,21.5;304,21.5;304.2,21.5;304.4,21.4;304.6,21.4;304.8,21.4;305,21.4;305.2,21.3;305.4,21.3;305.6,21.3;305.8,21.3;306,21.3;306.2,21.2;306.4,21.2;306.6,21.2;306.8,21.2;307,21.2;307.2,21.1;307.4,21.1;307.6,21.1;307.8,21;308,21;308.2,21;308.4,20.9;308.6,20.9;308.8,20.9;309,20.8;309.2,20.8;309.4,20.8;309.6,20.8;309.8,20.7;310,20.7;310.2,20.7;310.4,20.6;310.6,20.6;310.8,20.6;311,20.6;311.2,20.6;311.4,20.6;311.6,20.5;311.8,20.5;</Curve
<Curve Depth="1.1" FieldSize="350.0"
Thank you. Best regards, Maura (<mailto:maura.monville@gmail.com maura.monville@gmail.com>)

回答(1 个)

SAI SRUJAN
SAI SRUJAN 2024-7-8
Hi Maura,
I understand that you are facing an issue reading the xml file and parsing the data from the 'BeamData' element, and extract the pairs of values 'd_i' and 'v_i'.
Please follow the below code sample to proceed further,
xmlFile = 'yourfile.xml';
xDoc = xmlread(xmlFile);
% Navigate to the BeamData node or node of intrest.
beamDataNode = xDoc.getElementsByTagName('BeamData').item(0);
% Extract the text content of the BeamData node
dataStr = char(beamDataNode.getTextContent());
% Split the string by ';' to separate each pair
dataPairs = strsplit(dataStr, ';');
d_values = [];
v_values = [];
for i = 1:length(dataPairs)
if ~isempty(dataPairs{i})
% Split each pair by ','
values = strsplit(dataPairs{i}, ',');
% Convert strings to numbers and store in vectors
d_values(end+1) = str2double(values{1});
v_values(end+1) = str2double(values{2});
end
end
For a comprehensive understanding of the 'xmlread' and 'strsplit' functions in MATLAB, please refer to the following documentation.
I hope this helps!

类别

Help CenterFile Exchange 中查找有关 Structured Data and XML Documents 的更多信息

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by