关于读取TXT文件的问题。
我的文本文件的内容如下:
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中。
代码如下:
读取出来后我将显示第一行结果如下:
jersey NFL jersey Tampa Bay Buccaneers Tampa Bay Buccaneers TAMPA BAY BUCCANEERS NFL-029 """
从上面这个可以看出来读到"<"时就认为是换行回车了,可实际上又不是,请高手们帮我看看,如何解决这个问题。
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 """
从上面这个可以看出来读到"<"时就认为是换行回车了,可实际上又不是,请高手们帮我看看,如何解决这个问题。
...全文
相关推荐
Python3 解决读取中文文件txt编码的问题
今天小编就为大家分享一篇Python3 解决读取中文文件txt编码的问题,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧
解决Labview中关于读取txt文本文件,读出来是乱码的问题
解决Labview中关于读取txt文本文件,读出来是乱码的问题
ZK中使用JS读取客户端txt文件内容问题
主要介绍了ZK中使用JS读取客户端txt文件内容问题,本文通过实例图文相结合给大家介绍的非常详细,具有一定的参考借鉴价值,需要的朋友可以参考下
matlab 读txt 文件技巧
matlab 读txt 文件常见问题和解决办法
JAVA实现读取txt文件内容的方法
本篇文章主要介绍了JAVA实现读取txt文件内容的方法,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧



