0

我是 MySQL 新手,已经好几年没有编码了。我正在 MySQL Workbench 6.0 中构建数据库,需要从数据日志中导入多个 NEM12 文本文件。文本文件有一个记录指示符 (RI) 作为前 3 个字符(例如 200、300、900)。

我需要从 200 RI 行 (NMI) 中获取第二个条目并将其添加到以下 300 行,因为没有提及 NMI,但这是我感兴趣的信息。请注意,几百条 300 条线通常有一条 200 条线。更复杂的是,将有另外 200 行具有不同的 NMI,随后的 300 行用于新的 NMI。

NMI 数据记录 200

RecordIndicator,NMI,NMIConfiguration,RegisterID,NMISuffix,MDMDataStreamIdentifier,
MeterSerialNumber,UOM,IntervalLength,NextScheduledReadDate

例子

200,VABD000163,E1Q1,1,E1,N1,METSER123,kWh,30,20040120 

NMI 数据记录 300

RecordIndicator,IntervalDate,IntervalValue1。. . 区间值N,
质量方法、原因代码、原因描述、更新日期时间、MSATSLoadDateTime

例子

300,20030501,50.1, . . . ,21.5,V,,,20030101153445,20030102023012

下面的一些行来自日志文件 - 请注意,文件中的行之间没有行间隙

100,NEM12,201307101326,WBAYM,QEEE000514,

200,QEEE000514,E1Q1,,E1,N1,90401242,kWh,30,

300,20120701,67.46,80.42,85.38,85.22,82.3,79.23,71.23,81.41,93.82,100.93,125.89,113.79,102.37,117.25,125.7,140.16,134.14,127.62,123.3,144.13,144.48,157.73,141.28, 143.74,135.71,148.48,151.81,160.32,148.67,67,145.41,135.62,148.62,148.35,35,128.7,142.37,142.37,136.141,141,141,98.31,98.31,98.38.21,14,14,898.80,8686.868.898.898.898.8989.86898.8898.8898.898.898.,,, A,,,20120702013914,

300,20120702,61.63,74.69,80.45,78.46,77.31,74.91,65.57,77.63,97.82,126.78,119.84,131.58,130.08,138.75,111.74,118.94,121.66,128.45,121.47,142.46,139.1,153.82,121.09, 128.77,145.6,159.1,147.07,133.82,126.69,69,135.9,141.28,151.01.01.01,1,127.23,23,120.19,19,19,117.44,118,118,110.43.43.43.43.43.43.43.43 in A,,,20120703013936,

300,20120703,71.46,71.33,78.94,76.83,77.57,72.86,65.92,78.85,97.73,124.77,118.69,130​​.14,127.46,136.35,107.74,116.13,115.46,127.55,120.74,133.79,138.98,147.84,123.17, 123.33,117.98,133.66,122.69,137.28,128,129.73,120.45,45,139.81,150.37,37,128.32,32,120.74,112.74,112.67,112.67,115.46,1124,1124,124,127.24,1127,1127.255555555555555555555555555555555555555555559,112.112.112.2555555555555555555555559,112999转A,,,20120704013954,
300,20120704,73.95,82.62,88.19,87.81,81,87.78.78,83.04,75.26,85.26,85.26,85.34,94.98,94.98,98,119.07,112.86,122.24,124,124,124,123.84,123.84,131.3,112.112.110.9.us112.110.19.88,112.19.88.888men 113.95,119.1,144.8,135.87,123.2,109.25,116.77,113.76,133.95,126.24,119.3,105.86,107.39,107.52,111.81,109.22,111.36,100.19,98.88,86.27,80.8,72.16,75.33,70.56,74.02, A,,,20120705013928,

300,20120705,60.7,61.47,70.43,66.56,67.14,63.9,56,67.26,88.8,113.66,106.75,118.78,118.08,124.8,101.15,105.82,112.86,118.27,121.22,135.3,130.08,122.27,111.62, 120.26,105.12,12,13,13,139.52,134.5,116.32,12,124.03,125.31,131,137.98,98,111.52,52,11.52,11.97.97,117,117.25,117.25,1125,106.78,122.622.622.62.62.62.6.46.46.46.46.46.46.46 in A,,,20120706013931,
300,20120706,57.22,58.66,66.5,63.39,66.43,64.64,55.01,64.83,89.15,103.84,101.86,105.18,108.22,125.06,114.21,103.65,115.87,120.32,119.33,133.76,134.4,142.05,119.23, 126.94,122.78,148.06,141.86,124.16,114.27,116,109.6,134.82,127.52,127.71,111.36,119.9,114.62,125.09,109.89,122.08,113.02,106.3,87.26,80.38,72.29,78.34,73.98,77.09,A, ,,20120707013935,

300,20120707,64.61,66.21,72.22,70.85,75.14,72.93,62.75,71.46,79.81,96.54,108.38,100.93,112.45,125.18,117.44,103.36,113.86,128.35,122.59,130​​.08,122.82,119.52,123.74, 141.7,132.67,133.66,116.61,130.85,125.31,133.44,112.42,124.03,115.81,120.9,89.22,89.79,77.06,90.59,81.98,86.88,80.99,82.98,76,76.7,62.37,66.82,63.1,65.98, A,,,20120708013912,
300,20120708,57.15,69.15,73.18,75.1,73.22,70.43,63.68,72.9,84.83,104.99,107.36,103.17,95.04,110.02,113.66,129.63,128.9,121.76,119.04,134.14,120.86,125.57,136.16, 142.5,135.01,122.98,122.21,126.69,132.64,137.12,122.69,124.77,123.23,126.66,109.25,116.9,88.42,93.06,68.83,73.15,66.18,66.66,61.34,67.78,61.31,64.13,59.9,63.97, A,,,20120709013915,
300,20120709,52.96,65.57,72.48,70.46,69.95,68.68.16,59.68,59.68,72.99999990.90.90.91,91,122.43,115.04,124.58,58,124.5124.51,134.51,134.2112,112,112,112,112,112,112,1112,111111111111111111111111111111111111111111111111111111111111111111112999太平值127.46,125.44,133.92,127.04,135.01,134.98,136.67,109.28,132.1,129.73,136.48,120.35,120.93,112.19,128.19,115.71,124.77,117.15,111.71,97.44,91.46,81.92,82.69,80.51,82.91, A,,,20120710013929,
300,20120710,72.93,85.02,91.07,90.98,89.18,86.56,74.18,88.1,102.18,122.34,115.9,122.82,128.06,139.58,116.7,116.99,120.03,124.26,117.47,144.26,143.17,141.22,123.81, 124.32,115.97,148.45,144.7,147.94,124.38,126.66,66,118.53,142.98,136.98,136.13,134.59,134.59,118.27,121.95,95,121.11216,128,16,116,116,116,116,116,116,1116,116,116,1116,116,116,116,116,1116,116,116,116,116,116,116,116,111111111111111111111111111111111111111111111111111111111111111111111111999·2000 ,,20120711013916,
300,20120711,64.16,70.94,77.22,75.94,76.8,71.39,62.82,76.22,98.24,119.87,117.09,127.33,123.3,135.07,105.76,115.94,117.66,124.74,124.1,141.09,136.93,141.98,119.17, 126.78,119.04,135.78,140.7,144.19,127.07,120.61,117.6,129.89,133.22,140.48,122.62,128.67,114.08,121.82,115.87,125.86,111.2,108.58,94.37,91.97,80.58,84.06,80.38,80.86, A,,,20120712013916,
300,20120712,67.3,70.75,77.31,75.55,75.1,72.06,63.78,77.73,93.38,113.44,119.94,119.87,125.57,137.12,113.89,116.1,118.46,123.17,127.49,142.18,145.38,150.98,135.26, 134.62,136.42,164.74,155.78,142.4,135.04,140.51,126.21,145.09,138.3,137.18,126.69,126.37,125.47,129.86,120.32,117.76,110.69,112.26,98.18,92.38,81.54,86.98,81.73,86.27, A,,,20120713013923,
300,20120713,65.02,73.06,77.02,75.71,75.39,72.38,64.86,75.49,97.82,113.6,117.18,116.38,117.25,137.31,127.78,121.15,127.39,123.55,118.27,134.66,143.65,145.34,128.9, 140.32,142.5,147.65,134.05,155.01,129.82,123.33,114.88,126.59,118.02,122.66,115.62,116.51,105.79,118.14,107.9,113.86,104.38,108.1,93.41,92.96,72.96,75.3,69.76,72.86, A,,,20120714014000,
300,20120714,63.74,78.56,81.82,82,82.98,80.54,799.78,69.78,69.73,82.4,82.4,103.17,17,123.84,128.78,78,128,128.1,131,131,1444.99.99.99.99.99.9.99.99.99.ct 139.23,153.92,162.08,172.83,142.98,142.3,145.345.34,149.25,134.24,134.24,24,124,125.12,12,126.27,27,211,999.07.42,87.42,42,90.42,90.27.27.27.27.27.279.99.99.99.99.99.ct A,,,20120715014259,
300,20120715,63.52,77.18,82.46,81.95,80.61,77.63,69.66,83.42,96.32,104.58,110.18,122.08,106.5,134.53,135.55,133.44,107.65,124.35,124.35,130.75,136.67,147.01,142.72, 126.37,124.74,154.5,139.55,128.54,121.31.31,129.38,118,118.37,128.37,128.51,11,118.5,118.5,118.91,118.91,11,11,112.42,42,82.9898,89.9898,76.98,76.96.98.96.98.96.98.96.98.96.98,,,76.96.96.98.96.99.99.98. ,, A,,,20120716013951,
300,20120716,63.9,86.4,90.24,91.01,01,90.11,11,85.31,85.31,78.43,43,87.9.9,9,9,9,9,9,102.08,126,126,125.18,1313136,36,36,13,13,134,121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212294,1294,12211119994,11294,112121212294,1294,1221111994,1221111转131.55,121.22,146.91,140.32,127.78,120.42,139.94,133.47,137.15,120,124.35,115.55,118.59,114.72,124.86,119.14,122.72,109.63,107.55,92.83,88.99,78.11,79.58,74.18,78.88,A, ,,20120717013928,
300,20120717,63.62,66.21,73.02,70.11,11,70.88,66.88,66.98,59.29.2,72.06,72.06,96,96,96.8,8,8,8,136.67,128.48.48,48,129.7,136,136,136,1397,139.97,1126.1126.1126.1126.1126.1123.26.26.26.26.269.99.99.99.99.cn。 149.31,144.32,164.16,159.36,141.18,136.03,142.18,149.66,166.11,142.37,133.95,131.78,133.22,125.15,130.3,127.74,128.38,125.28,120.96,98.11,93.31,87.33,91.55,80.9,94.14, A,,,20120718013923,
4

0 回答 0