zoukankan      html  css  js  c++  java
  • export data into .txt file

    Dim w1(,) As Double = CType(oW1, Array)
                        
    Dim cCount As Integer = w1.GetLength(1)
                        
    Dim rCount As Integer = w1.GetLength(0)

                        
    Dim sw As System.IO.StreamWriter
                        sw 
    = System.IO.File.CreateText("f:corr1.txt")


                        
    For i As Integer = 1 To rCount

                            
    For j As Integer = 1 To cCount
                                sw.Write(w1(i, j))
                                
    If j < cCount Then
                                    sw.Write(Microsoft.VisualBasic.Chr(
    9))
                                
    End If
                            
    Next j
                            
    If i < rCount Then
                                sw.Write(Microsoft.VisualBasic.Chr(
    13+ Microsoft.VisualBasic.Chr(10))
                            
    End If


                        
    Next i

                        sw.Close()


                        
    Dim w2(,) As Double = CType(oW2, Array)
                        
    Dim cCount2 As Integer = w2.GetLength(1)
                        
    Dim rCount2 As Integer = w2.GetLength(0)

                        
    Dim sw2 As System.IO.StreamWriter
                        sw2 
    = System.IO.File.CreateText("f:corr2.txt")


                        
    For i As Integer = 1 To rCount2

                            
    For j As Integer = 1 To cCount2
                                sw2.Write(w2(i, j))
                                
    If j < cCount2 Then sw2.Write(Microsoft.VisualBasic.Chr(9))
                            
    Next j
                            
    If i < rCount2 Then sw2.Write(Microsoft.VisualBasic.Chr(13+ Microsoft.VisualBasic.Chr(10))

                        
    Next i

                        sw2.Close()
  • 相关阅读:
    win7 64位操作系统下使用OFFICE2007 导入表格报错 未在本地计算机上注册 Microsoft.ACE.OLEDB.12.0
    armxilinxeabigcc 不是内部或外部命令,也不是可运行的程序
    上位机 串口 通信 协议
    ZYNQ 调试遇到的种种问题汇总[转帖]
    ZedBoard 安装 Ubuntu11.04
    What the difference between .ipa and .app
    How to create a .ipa file for ios app?
    获取IOS客户端系统版本号
    ios软件支持双语(本地化、国际化)
    objectivec中判断对象是否属于某个类的方法
  • 原文地址:https://www.cnblogs.com/silva/p/336871.html
Copyright © 2011-2022 走看看