还是上次的问题,在参考各位高手在论坛的各种方法,仍没能完成,文件内容如下:
&T AIAA
p0=90-
br_no=5588(本部)
br_name= 宏峰公司
yy=2006
0=08
1=01
ccy=人民币
itm=10000
itm_name=
l_dbt_bal= 574,916.87
l_crt_bal= 0.00
dbt_amt= 2,432,480.00
crd_amt= 2,050,820.22
dbt_bal= 956,576.65
crd_bal= 0.00
&L
itm=10100
itm_name=库存现金
l_dbt_bal= 574,916.87
l_crt_bal= 0.00
dbt_amt= 2,432,480.00
crd_amt= 2,050,820.22
dbt_bal= 956,576.65
crd_bal= 0.00
&L
itm=10101
itm_name=库存现金
l_dbt_bal= 574,916.87
l_crt_bal= 0.00
dbt_amt= 2,432,480.00
crd_amt= 2,050,820.22
dbt_bal= 956,576.65
crd_bal= 0.00
&L
itm=12000
itm_name=
l_dbt_bal= 111,898,001.14
l_crt_bal= 0.00
dbt_amt= 6,994,598.23
crd_amt= 7,327,528.32
dbt_bal= 111,565,071.05
crd_bal= 0.00
&L
itm=12300
itm_name=
l_dbt_bal= 99,180,000.00
l_crt_bal= 0.00
dbt_amt= 0.00
crd_amt= 0.00
dbt_bal= 99,180,000.00
crd_bal= 0.00
&L
&L line
itm=12301
itm_name=
l_dbt_bal= 9,180,000.00
l_crt_bal= 0.00
dbt_amt= 0.00
crd_amt= 0.00
dbt_bal= 9,180,000.00
crd_bal= 0.00
&L
itm=12303
itm_name=
l_dbt_bal= 90,000,000.00
l_crt_bal= 0.00
dbt_amt= 0.00
crd_amt= 0.00
dbt_bal= 90,000,000.00
crd_bal= 0.00
&L
.
.
.
我想读取红色的内容和“=”后面的数字,代码如下:
Private Sub Command1_Click()
Open Text1.Text For Input As #1
Dim strAll() As String
Dim s As String
Dim i As Integer
Dim j As String
Dim m As Integer, n As Integer
j = "="
Line Input #1, s
s = Trim(s)
strAll = Split(s, vbCrLf)
For i = LBound(strAll) To UBound(strAll)
For n = 1 To Len(strAll(i))
m = InStrRev(strAll(i), j, -1)
Next n
Text2.Text = Right(strAll(i), Len(strAll(i)) - m)
Next i
Close #1
End Sub
Private Sub Form_load()
Text1.Text = App.Path & "\AI3520779901"
End Sub
我写完代码运行后,只读取最后一行的数字,而不是我要的内容,我没加红色部分代码前可以全部内容。我的代码错在哪了?谢谢指教。