有谁帮忙解决一个数组的问题
我有一个文本文件,里面有大量的数据。有4000行17列,第一列是时间,其余的列都是小数点后两位的数,我想把其中的一列提取出来画曲线图。我想把所有的数据赋值给一个二维数组后来操作应该怎样赋值呢?本帖最后由 comeheres 于 2013-8-13 11:25 编辑
不想多说了,自己看源码
http://bbs.fishc.com/data/attachment/album/201308/13/004922s0soh4069e4a9p1e.gif
用stringlist是以行为单位的 COPY呗 然后 写成一行不用加{} 他会自动分行的 比如你的数据是 1 2 3
4 5 6
7 8 9
你COPY过去后就写成 float i={123456789};
然后定义指针来读取啊
具体请看我的日志 我写了代码和注释
http://bbs.fishc.com/home.php?mod=space&uid=217717&do=blog&id=1770
如果觉得好就给最佳啊 话说你学了指针吗 这个方法我是用到了指针
不懂的话可以联系我 或者看甲鱼的视频 不懂可以追问 牡丹花下死做鬼 发表于 2013-8-12 10:27 static/image/common/back.gif
COPY呗 然后 写成一行不用加{} 他会自动分行的 比如你的数据是 1 2 3
...
他问的是Delphi 吧,你那是C{:5_93:} comeheres 发表于 2013-8-12 11:16 static/image/common/back.gif
他问的是Delphi 吧,你那是C
不好意思 我是在提问互助里看的 没看到是 delphi7{:5_91:} 看看这篇文章 http://www.xuedelphi.cn/wenzhang/pascal/2007/12/200712302013.htm
不懂可以问 我建议你把数据文件发上来,要先搞清楚你的数据的分隔的方式是什么, 16:19:25047.8000.0000.0000.0000.0000.0036.6000.0054.2055.4060.3047.0000.0000.0000.0000.0
16:20:30047.7000.0000.0000.0000.0000.0036.7000.0054.6056.4060.0046.9000.0000.0000.0000.0
16:21:24047.5000.0000.0000.0000.0000.0036.7000.0055.5057.8059.9046.8000.0000.0000.0000.0
16:22:30047.4000.0000.0000.0000.0000.0036.7000.0056.5059.7059.7046.8000.0000.0000.0000.0
16:23:24047.3000.0000.0000.0000.0000.0036.7000.0057.4061.0059.6046.8000.0000.0000.0000.0
16:24:30047.2000.0000.0000.0000.0000.0036.7000.0058.8062.6059.4046.7000.0000.0000.0000.0
16:25:24047.1000.0000.0000.0000.0000.0036.6000.0059.9063.7059.4046.8000.0000.0000.0000.0
16:26:30047.1000.0000.0000.0000.0000.0036.7000.0060.7064.8059.3046.8000.0000.0000.0000.0
16:27:24047.0000.0000.0000.0000.0000.0036.7000.0061.3065.6059.1046.6000.0000.0000.0000.0
16:28:29046.9000.0000.0000.0000.0000.0036.7000.0062.3066.5059.0046.6000.0000.0000.0000.0
16:29:24046.8000.0000.0000.0000.0000.0036.7000.0063.0067.2058.9046.6000.0000.0000.0000.0
16:30:29046.8000.0000.0000.0000.0000.0036.7000.0063.3067.9058.7046.6000.0000.0000.0000.0
16:31:24046.8000.0000.0000.0000.0000.0036.7000.0063.6068.5058.5046.6000.0000.0000.0000.0
16:32:29046.9000.0000.0000.0000.0000.0036.7000.0064.0069.1058.4046.6000.0000.0000.0000.0
16:33:24046.8000.0000.0000.0000.0000.0036.6000.0064.6069.5058.3046.6000.0000.0000.0000.0
16:34:29046.7000.0000.0000.0000.0000.0036.7000.0065.1070.1058.2046.5000.0000.0000.0000.0
16:35:24046.8000.0000.0000.0000.0000.0036.7000.0065.5070.5058.0046.5000.0000.0000.0000.0
16:36:29046.8000.0000.0000.0000.0000.0036.7000.0065.8070.8057.9046.4000.0000.0000.0000.0
16:37:23046.7000.0000.0000.0000.0000.0036.5000.0066.1071.2057.8046.4000.0000.0000.0000.0
16:38:29046.6000.0000.0000.0000.0000.0036.6000.0066.6071.5057.6046.4000.0000.0000.0000.0
16:39:23046.8000.0000.0000.0000.0000.0036.6000.0067.0071.8057.4046.3000.0000.0000.0000.0
16:40:29046.7000.0000.0000.0000.0000.0036.6000.0067.4072.1057.3046.3000.0000.0000.0000.0
16:41:23046.7000.0000.0000.0000.0000.0036.5000.0067.6072.5057.2046.3000.0000.0000.0000.0
16:42:29046.8000.0000.0000.0000.0000.0036.6000.0067.7072.8057.0046.2000.0000.0000.0000.0
16:43:23046.8000.0000.0000.0000.0000.0036.5000.0068.0073.1056.9046.2000.0000.0000.0000.0
16:44:28046.8000.0000.0000.0000.0000.0036.6000.0068.2073.3056.7046.2000.0000.0000.0000.0
16:45:23046.8000.0000.0000.0000.0000.0036.5000.0068.3073.6056.6046.2000.0000.0000.0000.0
16:46:28046.8000.0000.0000.0000.0000.0036.5000.0068.4073.8056.5046.1000.0000.0000.0000.0
16:47:23046.9000.0000.0000.0000.0000.0036.6000.0068.5074.0056.3046.1000.0000.0000.0000.0
16:48:28046.8000.0000.0000.0000.0000.0036.6000.0068.9074.3056.2045.9000.0000.0000.0000.0
16:49:23046.8000.0000.0000.0000.0000.0036.5000.0069.0074.4055.9046.0000.0000.0000.0000.0
16:50:28046.9000.0000.0000.0000.0000.0036.5000.0069.1074.7055.8045.9000.0000.0000.0000.0
16:51:23046.9000.0000.0000.0000.0000.0036.5000.0069.1074.8055.6045.9000.0000.0000.0000.0
16:52:28046.9000.0000.0000.0000.0000.0036.5000.0069.3075.0055.5045.8000.0000.0000.0000.0
16:53:23046.9000.0000.0000.0000.0000.0036.5000.0069.5075.1055.3045.8000.0000.0000.0000.0
16:54:28046.9000.0000.0000.0000.0000.0036.5000.0069.6075.4055.2045.8000.0000.0000.0000.0
16:55:22047.0000.0000.0000.0000.0000.0036.5000.0069.7075.5055.1045.7000.0000.0000.0000.0
16:56:28047.1000.0000.0000.0000.0000.0036.5000.0069.9075.6054.9045.6000.0000.0000.0000.0
16:57:22047.0000.0000.0000.0000.0000.0036.4000.0070.1075.8054.8045.6000.0000.0000.0000.0
16:58:28047.1000.0000.0000.0000.0000.0036.5000.0070.1075.9054.6045.6000.0000.0000.0000.0
16:59:22047.1000.0000.0000.0000.0000.0036.5000.0070.1076.0054.5045.5000.0000.0000.0000.0
17:00:28047.1000.0000.0000.0000.0000.0036.5000.0070.3076.1054.3045.4000.0000.0000.0000.0
17:01:22047.2000.0000.0000.0000.0000.0036.5000.0070.6076.3054.2045.4000.0000.0000.0000.0
17:02:27047.1000.0000.0000.0000.0000.0036.4000.0070.7076.4054.1045.3000.0000.0000.0000.0
17:03:22047.2000.0000.0000.0000.0000.0036.4000.0070.7076.4053.9045.3000.0000.0000.0000.0
17:04:27047.2000.0000.0000.0000.0000.0036.4000.0070.6076.5053.7045.3000.0000.0000.0000.0
17:05:22047.2000.0000.0000.0000.0000.0036.3000.0070.7076.6053.6045.2000.0000.0000.0000.0
17:06:27047.3000.0000.0000.0000.0000.0036.3000.0070.7076.6053.4045.2000.0000.0000.0000.0
17:07:22047.2000.0000.0000.0000.0000.0036.4000.0070.7076.7053.3045.1000.0000.0000.0000.0
17:08:27047.3000.0000.0000.0000.0000.0036.4000.0071.0076.7053.1045.0000.0000.0000.0000.0
17:09:22047.3000.0000.0000.0000.0000.0036.4000.0071.1076.9053.0045.0000.0000.0000.0000.0
17:10:27047.3000.0000.0000.0000.0000.0036.4000.0071.2076.9052.9045.0000.0000.0000.0000.0
17:11:21047.4000.0000.0000.0000.0000.0036.3000.0071.2076.9052.7044.9000.0000.0000.0000.0
17:12:27047.4000.0000.0000.0000.0000.0036.3000.0071.3077.0052.4044.8000.0000.0000.0000.0
17:13:21047.4000.0000.0000.0000.0000.0036.3000.0071.5077.0052.4044.9000.0000.0000.0000.0
17:14:27047.4000.0000.0000.0000.0000.0036.3000.0071.6077.1052.3044.7000.0000.0000.0000.0
17:15:21047.5000.0000.0000.0000.0000.0036.3000.0071.6077.1052.0044.7000.0000.0000.0000.0
17:16:27047.4000.0000.0000.0000.0000.0036.3000.0071.6077.1051.9044.6000.0000.0000.0000.0
17:17:21047.4000.0000.0000.0000.0000.0036.2000.0071.6077.1051.9044.6000.0000.0000.0000.0
17:18:27047.5000.0000.0000.0000.0000.0036.2000.0071.7077.2051.7044.6000.0000.0000.0000.0
17:19:21047.5000.0000.0000.0000.0000.0036.2000.0071.7077.2051.6044.5000.0000.0000.0000.0
17:20:26047.5000.0000.0000.0000.0000.0036.2000.0071.8077.1051.4044.5000.0000.0000.0000.0
17:21:21047.6000.0000.0000.0000.0000.0036.2000.0071.7077.2051.3044.5000.0000.0000.0000.0
17:22:26047.6000.0000.0000.0000.0000.0036.2000.0071.9077.2051.2044.4000.0000.0000.0000.0
17:23:21047.6000.0000.0000.0000.0000.0036.2000.0072.0077.2051.0044.2000.0000.0000.0000.0
17:24:26047.6000.0000.0000.0000.0000.0036.2000.0071.9077.3050.8044.2000.0000.0000.0000.0
17:25:21047.6000.0000.0000.0000.0000.0036.2000.0071.9077.3050.8044.2000.0000.0000.0000.0
17:26:26047.7000.0000.0000.0000.0000.0036.2000.0071.9077.3050.7044.2000.0000.0000.0000.0
17:27:21047.7000.0000.0000.0000.0000.0036.2000.0071.9077.3050.4044.1000.0000.0000.0000.0
17:28:26047.7000.0000.0000.0000.0000.0036.2000.0071.9077.4050.4044.0000.0000.0000.0000.0
17:29:20047.7000.0000.0000.0000.0000.0036.2000.0072.0077.5050.3044.1000.0000.0000.0000.0
17:30:26047.8000.0000.0000.0000.0000.0036.1000.0072.0077.4050.1044.0000.0000.0000.0000.0
17:31:20047.7000.0000.0000.0000.0000.0036.2000.0071.9077.3050.0044.0000.0000.0000.0000.0
17:32:26047.8000.0000.0000.0000.0000.0036.2000.0071.9077.4049.8043.9000.0000.0000.0000.0
17:33:20047.7000.0000.0000.0000.0000.0036.1000.0071.9077.4049.8043.8000.0000.0000.0000.0
17:34:26047.8000.0000.0000.0000.0000.0036.1000.0071.8077.4049.7043.9000.0000.0000.0000.0
17:35:31047.8000.0000.0000.0000.0000.0036.2000.0071.9077.4049.4043.7000.0000.0000.0000.0
17:36:25047.9000.0000.0000.0000.0000.0036.2000.0072.0077.3049.3043.7000.0000.0000.0000.0
17:37:31047.9000.0000.0000.0000.0000.0036.2000.0072.0077.5049.2043.7000.0000.0000.0000.0
17:38:25047.8000.0000.0000.0000.0000.0036.1000.0071.9077.4049.1043.6000.0000.0000.0000.0
17:39:31047.8000.0000.0000.0000.0000.0036.2000.0071.9077.4049.0043.6000.0000.0000.0000.0
17:40:25047.9000.0000.0000.0000.0000.0036.2000.0071.8077.4048.9043.5000.0000.0000.0000.0
17:41:31047.9000.0000.0000.0000.0000.0036.2000.0071.8077.5048.8043.5000.0000.0000.0000.0
17:42:25047.9000.0000.0000.0000.0000.0036.1000.0071.9077.5048.7043.4000.0000.0000.0000.0
17:43:31047.9000.0000.0000.0000.0000.0036.1000.0071.9077.5048.6043.4000.0000.0000.0000.0
17:44:25048.0000.0000.0000.0000.0000.0036.1000.0071.9077.5048.4043.3000.0000.0000.0000.0
17:45:30047.9000.0000.0000.0000.0000.0036.1000.0071.9077.5048.3043.3000.0000.0000.0000.0
17:46:25047.9000.0000.0000.0000.0000.0036.0000.0071.8077.5048.3043.3000.0000.0000.0000.0
17:47:30047.9000.0000.0000.0000.0000.0036.0000.0071.7077.3048.1043.3000.0000.0000.0000.0
17:48:25047.9000.0000.0000.0000.0000.0036.1000.0071.6077.4047.9043.1000.0000.0000.0000.0
17:49:30048.0000.0000.0000.0000.0000.0036.1000.0071.6077.3047.9043.1000.0000.0000.0000.0
17:50:25048.0000.0000.0000.0000.0000.0036.0000.0071.7077.2047.7043.1000.0000.0000.0000.0
17:51:30047.9000.0000.0000.0000.0000.0036.1000.0071.6077.2047.7043.0000.0000.0000.0000.0
17:52:25048.1000.0000.0000.0000.0000.0036.1000.0071.5077.2047.5042.9000.0000.0000.0000.0
17:53:30048.1000.0000.0000.0000.0000.0036.1000.0071.7077.2047.3042.9000.0000.0000.0000.0
17:54:24048.1000.0000.0000.0000.0000.0036.0000.0071.9077.1047.3042.9000.0000.0000.0000.0
17:55:30048.0000.0000.0000.0000.0000.0036.0000.0071.9077.1047.2042.9000.0000.0000.0000.0
17:56:24048.1000.0000.0000.0000.0000.0036.0000.0071.9077.1047.1042.8000.0000.0000.0000.0
17:57:30048.0000.0000.0000.0000.0000.0036.0000.0071.9077.2047.0042.8000.0000.0000.0000.0
17:58:24048.0000.0000.0000.0000.0000.0036.0000.0071.9077.1047.0042.7000.0000.0000.0000.0
17:59:30048.0000.0000.0000.0000.0000.0035.9000.0072.0077.1046.9042.7000.0000.0000.0000.0
18:00:24048.1000.0000.0000.0000.0000.0036.0000.0072.0077.0046.7042.6000.0000.0000.0000.0
18:01:29048.1000.0000.0000.0000.0000.0035.9000.0072.0077.0046.6042.5000.0000.0000.0000.0
18:02:24048.1000.0000.0000.0000.0000.0035.8000.0072.1077.0046.6042.5000.0000.0000.0000.0
18:03:29048.1000.0000.0000.0000.0000.0035.9000.0072.0077.0046.4042.5000.0000.0000.0000.0
18:04:24048.1000.0000.0000.0000.0000.0035.9000.0071.9076.9046.3042.4000.0000.0000.0000.0
18:05:29048.1000.0000.0000.0000.0000.0035.9000.0071.9076.8046.2042.4000.0000.0000.0000.0
18:06:24048.1000.0000.0000.0000.0000.0035.9000.0071.9076.9046.2042.3000.0000.0000.0000.0
18:07:29048.0000.0000.0000.0000.0000.0035.9000.0071.8076.8046.1042.3000.0000.0000.0000.0
18:08:24048.1000.0000.0000.0000.0000.0035.8000.0071.8076.7046.0042.2000.0000.0000.0000.0
18:09:29048.1000.0000.0000.0000.0000.0035.9000.0071.7076.6045.9042.2000.0000.0000.0000.0
18:10:24048.1000.0000.0000.0000.0000.0035.8000.0071.7076.6045.8042.1000.0000.0000.0000.0
18:11:29048.1000.0000.0000.0000.0000.0035.8000.0071.7076.7045.7042.1000.0000.0000.0000.0
18:12:23048.2000.0000.0000.0000.0000.0035.8000.0071.6076.6045.6042.0000.0000.0000.0000.0
18:13:29048.1000.0000.0000.0000.0000.0035.8000.0071.5076.5045.5042.0000.0000.0000.0000.0
18:14:23048.1000.0000.0000.0000.0000.0035.8000.0071.5076.5045.4042.0000.0000.0000.0000.0
18:15:29048.1000.0000.0000.0000.0000.0035.8000.0071.5076.4045.4042.0000.0000.0000.0000.0
18:16:23048.1000.0000.0000.0000.0000.0035.9000.0071.3076.4045.2041.9000.0000.0000.0000.0
18:17:29048.1000.0000.0000.0000.0000.0035.8000.0071.2076.3045.2041.9000.0000.0000.0000.0
18:18:23048.1000.0000.0000.0000.0000.0035.8000.0071.2076.3045.1041.9000.0000.0000.0000.0
18:19:28048.1000.0000.0000.0000.0000.0035.8000.0071.1076.2045.0041.9000.0000.0000.0000.0
18:20:23048.1000.0000.0000.0000.0000.0035.7000.0071.0076.2044.9041.8000.0000.0000.0000.0
就是这种格式 最好是具体一点,谢谢了 这个太难了,涉及到字符串的格式化读取。。
至少我还不会{:7_155:} comeheres 发表于 2013-8-12 08:42 static/image/common/back.gif
不想多说了,自己看源码
这个要支持下,热心帮助他人
页:
[1]