dim inMsg as string, outMsg as string, Temp as string
close #1
open "1.txt" for input as #1
close #2
open "2.txt" for output as #1
do until eof(1)
read #1, inMsg
outMsg=right(inMsg, len(inMsg)-3)
outMsg=left(outMsg, len(outMes)-11)
temp=right(inMsg, 11)
temp=trim(val(temp))
outMsg=outMsg & temp
print #2, outMsg
loopOK, hehe
close #1
open "1.txt" for input as #1
close #2
open "2.txt" for output as #1
do until eof(1)
read #1, inMsg
outMsg=right(inMsg, len(inMsg)-3)
outMsg=left(outMsg, len(outMes)-11)
temp=right(inMsg, 11)
temp=trim(val(temp))
outMsg=outMsg & temp
print #2, outMsg
loopOK, hehe
解决方案 »
- VB显示网页的问题
- 数据库小问题,插入程序,但我不会,请帮忙解决
- Private cnSIMS As ADODB.Connection
- VSprinter控件制表格,但表格线的粗细却不不一样!怎么办?!
- 在VBS中按windows默认方式打开文件出错,在线等,TKS!
- 如何让VB找出隐藏的进程呢
- 如何判断注册表中某一键是否存在?急!谢谢
- 请问VB中有等价于VC中DWORD的32位无符号整数的数据类型吗?
- 求助:在不安装VB6的环境运行时MSFlexGrid1与 Data1连接不上!
- 相对路径的问题
- 谁知道设置活动桌面的代码?
- 谁有收发手机短信的VB程序代码,请email给我一份,谢(给分!给分!)[email protected]
TO:onlineboy(stame) read #1, inMsg 这句通部过呀!老是是说子程序或函数未定义!
详细点,我是初学者!!
Dim nStr() As String
Dim lineStr As String
Dim i As Long
Open "c:\1.txt" For Input As #1
Open "c:\2.txt" For Output As #2
Do Until EOF(1)
Line Input #1, lineStr
nStr = Split(lineStr, "|")
nStr(LBound(nStr)) = Right(nStr(LBound(nStr)), 4)
nStr(UBound(nStr)) = Format(Val(nStr(UBound(nStr))))
lineStr = ""
For i = LBound(nStr) To UBound(nStr)
lineStr = lineStr & "|" & nStr(i)
Next i
lineStr = Mid(lineStr, 1)
Print #2, lineStr
Loop
Close #1
Close #2
End Sub
谢了!出来的效果是
|3958|1234567 |张涛 |2000
|3959|12334455 |爱吗而 |2000
|3960|12345678 |jjjj |5000
|3961|12345678 |jjjj |10000
|3962|1234567890 |1234 |2000
|3963|12345678 |jjjj |50000
|3964|1234567 |123 |2000
|3965|12334455 |abc |55555555.55
|3966|1234567 |123 |99999999.99
|4113|1234567 |123 |88888888.88前面多了个“|”,如何使出来的效果使3964|1234567 |123 |2000
3965|1234567 |123 |2000
3966|1234567 |123 |2000