以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  导入文本文件的问题  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=76496)

--  作者:fntfgz
--  发布时间:2015/10/30 12:14:00
--  导入文本文件的问题
 我有一SQLite数据库,已经导出为txt文件,如下,想导入咱们ft,但是有列分割符咋没有行分割符哇,我用易表就可以成功导入的,狐表咋不行啊
"Pro_Id","name","xzb","yzb","filename","id"
"2","安庆","180","335","anhui.gif","2"
"2","蚌埠","170","140","anhui.gif","3"
 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:aaaa.txt



刚才用快递导入已经解决了,但是用导入文本文件就出上面的问题
[此贴子已经被作者于2015/10/30 12:29:02编辑过]

--  作者:大红袍
--  发布时间:2015/10/30 12:35:00
--  

先处理一下txt文件

 

Dim dlg As new OpenFileDialog
dlg.Filter = "文本文件|*.txt"
If dlg.ShowDialog = DialogResult.OK Then
    Dim count As Integer = 5
    Dim strs As String = FileSys.ReadAllText(dlg.FileName, Encoding.default)
    Dim temp As Integer = 0
    Dim nstr As String = ""
    For Each s As String In strs.Split(",")
        temp += 1
        nstr &= s
        If temp Mod count = 0 Then
            nstr &= vbcrlf
        Else
            nstr &= ","
        End If
    Next
    filesys.WriteAllText("d:\\test.txt", nstr, False,Encoding.default)
End If