双11狂欢大促

盲盒赢 定制羽绒服

开启惊喜盲盒,抽取你的专属好礼

— 惊喜奖品抢先看 —

关于读取TXT文件的问题。

zjx1302 zjx1302 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
我的文本文件的内容如下:
cata4 cata5 cata6 name sn Descriptions pic1 pic2 stocknum jg l Operator
jersey NFL jersey Tampa Bay Buccaneers Tampa Bay Buccaneers TAMPA BAY BUCCANEERS NFL-029 """<DIV align=center>
<TABLE cellPadding=0 width=""""93%"""" align=center border=1>
<TBODY>
<TR>
<TD width=""""99%"""">
<DIV align=center><FONT face=""""Times New Roman"""" color=#11ee3d size=3><STRONG>If you cannot get the players that displayed on our web, you can contact our online service or email us to get newest stock list, Also we can help you to produce jerseys that you want to satisfy you. Thanks.</STRONG></FONT></DIV></TD></TR></TBODY></TABLE></DIV>""" 20100522021112220-s.jpg 20100522021112220-s.jpg 180 0 8 1
jersey NFL jersey Tampa Bay Buccaneers Tampa Bay Buccaneers TAMPA BAY BUCCANEERS NFL-030 """<DIV align=center>
<TABLE cellPadding=0 width=""""93%"""" align=center border=1>
<TBODY>
<TR>
<TD width=""""99%"""">
<DIV align=center><FONT face=""""Times New Roman"""" color=#11ee3d size=3><STRONG>If you cannot get the players that displayed on our web, you can contact our online service or email us to get newest stock list, Also we can help you to produce jerseys that you want to satisfy you. Thanks.</STRONG></FONT></DIV></TD></TR></TBODY></TABLE></DIV>""" 20100522021112220-s.jpg 20100522021112220-s.jpg 180 0 8 1
jersey NFL jersey Tampa Bay Buccaneers Tampa Bay Buccaneers TAMPA BAY BUCCANEERS NFL-031 """<DIV align=center>
<TABLE cellPadding=0 width=""""93%"""" align=center border=1>
<TBODY>
<TR>
<TD width=""""99%"""">
<DIV align=center><FONT face=""""Times New Roman"""" color=#11ee3d size=3><STRONG>If you cannot get the players that displayed on our web, you can contact our online service or email us to get newest stock list, Also we can help you to produce jerseys that you want to satisfy you. Thanks.</STRONG></FONT></DIV></TD></TR></TBODY></TABLE></DIV>""" 20100522021112220-s.jpg 20100522021112220-s.jpg 180 0 8 1


上面这些数据库从EXCEL导成制表符TXT文件,一共有三条记录我现在将这个数据读取出来然后把对应的字段写入ACCESS中。
代码如下:


set MyFileObject=server.CreateObject("Scripting.FileSystemObject")
set MyLogFile=MyFileObject.OpenTextFile(server.MapPath(a&filenameback&"."&filekzmzz),1)
response.write a&filenameback&"."&filekzmzz
k=0
while not MyLogFile.AtEndOfStream
if k=0 then '去掉第一行,第一行是标题
LogMessage=Trim(MyLogFile.readline)
response.write "<br>" & logMessage & "<br>"
k=k+1
end if
LogMessage=Trim(MyLogFile.readline)
response.write "<br>" & logMessage & "<br>"

if LogMessage<>"" then
LogArr = split(LogMessage,vbTab)
response.write "<br>5:" & Trim(LogArr(5)) & "<br>4:" &Trim(LogArr(4)) & "<br>3:" &Trim(LogArr(3)) & "<br>2:" &Trim(LogArr(2)) & "<br>1:"&Trim(LogArr(1)) & "<br>0:"&Trim(LogArr(0))
response.end
end if
wend

读取出来后我将显示第一行结果如下:
jersey NFL jersey Tampa Bay Buccaneers Tampa Bay Buccaneers TAMPA BAY BUCCANEERS NFL-029 """
从上面这个可以看出来读到"<"时就认为是换行回车了,可实际上又不是,请高手们帮我看看,如何解决这个问题。
...全文

相关推荐

评论 3
收藏 已收藏
分享
返回顶部
zjx1302
ASP 28,401 成员 356,938 内容