PureBasic 读取文件中一行的两个数据例子

PureBasic 读取文件中一行的两个数据例子
If ReadFile(0, "Test1.txt")   ; if the file could be read, we continue...
  If CreateFile(1, "Test2.txt") 
  While Eof(0) = 0     ; loop as long the 'end of file' isn't reached
    Astring$=ReadString(0)
    A$=StringField(Astring$,1,",")
    B$=StringField(Astring$,2,",")
    WriteStringN(1, A$+","+B$)
    Wend
    CloseFile(0)               ; close the previously opened file
    CloseFile(1)
    EndIf
  Else
    MessageRequester("信息","文件无法打开!")
  EndIf

 

posted on 2013-08-16 16:22  向北方 阅读( ...) 评论( ...) 编辑 收藏

转载于:https://www.cnblogs.com/China3S/p/3262421.html

你可能感兴趣的:(PureBasic 读取文件中一行的两个数据例子)