以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  导入后文字是乱码,数字中有,号怎么改  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=40345)

--  作者:zhaohj611718
--  发布时间:2013/9/16 10:28:00
--  导入后文字是乱码,数字中有,号怎么改

明细查询文件下载

    卡号:    卡别名:

    子账户序号: 000    子账户类别: 活期    子账户别名: 基本户

  ^交易日期       ^摘要                ^交易场所                                                    ^交易国家或地区简称  ^钞/汇     ^交易金额(收入)      ^交易金额(支出)      ^交易币种       ^记账金额(收入)      ^记账金额(支出)      ^记账币种       ^余额
  ^2013-08-16     ^b2c                 ^网上银行                                                    ^CHN                 ^钞        ^-                   ^-                   ^-              ^                    ^4,276.00            ^人民币         ^303,796.69         
  ^2013-08-16     ^ATM转账             ^255医院自助银行                                             ^CHN                 ^钞        ^-                   ^-                   ^-              ^200.00              ^                    ^人民币         ^303,996.69         
  ^2013-08-16     ^b2c                 ^网上银行                                                    ^CHN                 ^钞        ^-                   ^-                   ^-              ^                    ^321.50              ^人民币         ^303,675.19         
  ^2013-08-16     ^b2c                 ^网上银行                                                    ^CHN                 ^钞        ^-                   ^-                   ^-              ^                    ^342.00              ^人民币         ^303,333.19         
  ^2013-08-16     ^b2c                 ^网上银行                                                    ^CHN                 ^钞        ^-                   ^-                   ^-              ^                    ^261.50              ^人民币         ^303,071.69         
  ^2013-08-16     ^网转                ^网上银行                                                    ^CHN                 ^钞        ^-                   ^-                   ^-              ^                    ^8,250.00            ^人民币         ^294,821.69         
  ^2013-08-16     ^b2c                 ^网上银行                                                    ^CHN                 ^钞        ^-                   ^-                   ^-              ^                    ^367.00              ^人民币         ^294,454.69         
  ^2013-08-16     ^汇款                ^唐山遵化北关支行                                            ^CHN                 ^钞        ^-                   ^-                   ^-              ^20,600.00           ^                    ^人民币         ^315,054.69         
  ^2013-08-16     ^转帐                ^                                                            ^CHN                 ^钞        ^-                   ^-                   ^-              ^                    ^100.00              ^人民币         ^314,954.69         
  ^2013-08-16     ^b2c                 ^网上银行                                                    ^CHN                 ^钞        ^-                   ^-                   ^-              ^                    ^141.50              ^人民币         ^314,813.19         
  ^2013-08-16     ^网转                ^网上银行                                                    ^CHN                 ^钞        ^-                   ^-                   ^-              ^                    ^18,485.50           ^人民币         ^296,327.69         
  ^2013-08-16     ^b2c                 ^网上银行                                                    ^CHN                 ^钞        ^-                   ^-                   ^-              ^                    ^3,040.80            ^人民币         ^293,286.89         
  ^2013-08-17     ^b2c                 ^网上银行                                                    ^CHN                 ^钞        ^-                   ^-                   ^-              ^                    ^434.00              ^人民币         ^292,852.89         
  ^2013-08-17     ^b2c                 ^网上银行                                                    ^CHN                 ^钞        ^-                   ^-                   ^-              ^                    ^1,419.00            ^人民币         ^291,433.89         
  ^2013-08-17     ^b2c                 ^网上银行                                                    ^CHN                 ^钞        ^-                   ^-                   ^-              ^                    ^105.00              ^人民币         ^291,328.89         
  ^2013-08-17     ^b2c                 ^网上银行                                                    ^CHN                 ^钞        ^-                   ^-                   ^-              ^                    ^373.00              ^人民币         ^290,955.89         
 
   #人民币合计      

Dim dlg As new OpenFileDialog
dlg.Filter = "文本文件|*.txt"
Tables("表A").StopRedraw
If dlg.ShowDialog = DialogResult.OK Then
    Dim strs As String = FileSys.ReadAllText(dlg.FileName)
    strs = strs.Replace(vblf,"")
    Dim rs() As String = strs.Split(vbcr)
    For i As Integer = 7 To rs.Length - 1
        Dim cs() As String = rs(i).Split("^")
        If cs.Length > 6 Then
            Dim dr As DataRow = DataTables("表A").Addnew()
            dr("第一列") = cs(2)
            dr("第二列") = cs(3)
        End If
    Next
End If
Tables("表A").ResumeRedraw      

 

 

导入后发现文字是乱码,数字中有“,”怎么改代码


--  作者:Bin
--  发布时间:2013/9/16 10:31:00
--  
乱码是因为你文本文件编码有问题,改为UTF8看看吧

你数字本身就有 ,  啊  你自己替换去掉即可.

--  作者:有点甜
--  发布时间:2013/9/16 21:55:00
--  
 楼上的意思是,你打开.txt文件,另存为一个文件,保存的时候,选择字符集。