积极答复者
读取标准的行列式的TXT文件到网页

问题
-
我有个标准的行列式的TXT文件,我想先读取文件到mdb数据库,再放入网页,后面基本解决,前面不知道asp.net怎么读取标准的行列式的TXT文件到mdb数据库.我有这个ocx控件,也不知道怎么用
- 已编辑 Honny_yeyh 2011年12月29日 13:06
答案
-
[\w+,{1}]*\s*
用Regex.Matchs这个正则,然后得到Match的Value就是一行的记录
之后把第一行以String.Split的方法存到DataColumn
其他也以Split循环存到DataRow就可以了
- 已标记为答案 gsralexModerator 2012年1月4日 11:59
- 取消答案标记 gsralexModerator 2012年1月4日 11:59
- 已建议为答案 gsralexModerator 2012年1月4日 11:59
- 已标记为答案 gsralexModerator 2012年1月4日 12:07
-
[\w+,{1}]*\s* 这个什么意思? 哪个资料里面有有关正则取一行方面的资料?
Introduction to Regular Expressions by MSDN[入門][Regex] Regular Expression 詳論 (MVP Johnny.net)
- The blog of typewriter職人
- Convert C# to VB.NET
- /*If my concept is wrong ,please correct me.Thanks.*/
- 已编辑 Shadow .Net 2012年1月2日 10:06
- 已标记为答案 Song TianModerator 2012年1月4日 10:55
全部回复
-
我的话,会一行一行地读
然后拼接每个列的值为SQL Insert语句
再执行该SQL
不过建议您是否有Sample文件好让大伙们可以研究呢?说不定会有更好的解法
- The blog of typewriter職人
- Convert C# to VB.NET
- /*If my concept is wrong ,please correct me.Thanks.*/
-
txt content:
ID,name,sex,,match,chinese,english,phy,chem,total
CY001,cred,male,104,112,101,85,99
CY002,rose,female,87,105,98,119,101
CY003,helen,male,120,98,68,80,75
CY004,jack,female,98,68,115,91,85
CY005,tonny,male,96,88,111,87,68
average,null,null
listctrl:
ID name sex match chinese english phy chem total CY001 cred male 104 112 101 85 99 CY002 rose female 87 105 98 119 101 CY003 helen male 120 98 68 80 75 CY004 jack female 98 68 115 91 85 CY005 tonny male 96 88 111 87 68 average null null jpg:
先读取到数据库,再计算出总分,最下面添加上面每科成绩平均值,再更新数据库,最后再显示在网页的表格
- 已编辑 Honny_yeyh 2011年12月30日 1:57
-
[\w+,{1}]*\s*
用Regex.Matchs这个正则,然后得到Match的Value就是一行的记录
之后把第一行以String.Split的方法存到DataColumn
其他也以Split循环存到DataRow就可以了
- 已标记为答案 gsralexModerator 2012年1月4日 11:59
- 取消答案标记 gsralexModerator 2012年1月4日 11:59
- 已建议为答案 gsralexModerator 2012年1月4日 11:59
- 已标记为答案 gsralexModerator 2012年1月4日 12:07
-
[\w+,{1}]*\s* 这个什么意思? 哪个资料里面有有关正则取一行方面的资料?
Introduction to Regular Expressions by MSDN[入門][Regex] Regular Expression 詳論 (MVP Johnny.net)
- The blog of typewriter職人
- Convert C# to VB.NET
- /*If my concept is wrong ,please correct me.Thanks.*/
- 已编辑 Shadow .Net 2012年1月2日 10:06
- 已标记为答案 Song TianModerator 2012年1月4日 10:55