我有一個製表符分隔文本文件,像這樣:複製到自身
name \t loan period \t loan amount
John \t 5 years \t 6000
Sarah \t 5 years \t 6000
Jane \t 1 month \t 100
我期待複製行,其中「貸款期限」 =「5年內」去哪兒「貸款期限「=」1個月「,以顯示比較。新行會被附加到結果文件的末尾。
最終的落腳點我希望達到的目標是:
name \t loan period \t loan amount
John \t 5 years \t 6000
Sarah \t 5 years \t 6000
Jane \t 1 month \t 100
John \t 1 month \t 100
Sarah \t 1 month \t 100
我一直在玩弄這個與Visual Basic .NET中,到目前爲止,這是我想出
Dim strData As String
Dim i As Short
Dim strLine() As String
lngSize = 0
FileOpen(1, txtloanlistinput.Text, OpenMode.Input)
While Not EOF(1)
i = i + 1
strData = LineInput(1)
End While
FileClose(1)
ReDim loanlist(i)
strData = ""
lngSize = i
i = 0
FileOpen(2, txtloanlistinput.Text, OpenMode.Input)
While Not EOF(2)
i = i + 1
strData = LineInput(2)
If i = 1 Then
strData = LineInput(2)
End If
strLine = Split(strData, Chr(9))
loanlist(i).strName = strLine(0)
loanlist(i).strLoanPeriod = strLine(1)
loanlist(i).curLoanAmount = strLine(2)
End While
FileClose(1)
FileClose(2)
我在畫一個空白的如何進行,並認爲我會尋求幫助。這樣做的
謝謝,對於遲到的回覆感到抱歉。 – 2009-05-06 03:54:58