解决方案 »
- 求时间日期与字符转换函数!!
- txt导入到access时候出现问题???急
- 帮忙看看这个连接 (VB+SQL)
- ComboBox 如何控制相同数据重复加载
- 在windows API中 ,有无VisualFoxPro中FontMetrics 对应的函数????
- ◆数据导入excel下需要实现这样的效果?◆
- 难题:如何对鼠标进行完全操作?就像“按键精灵”中可以模拟鼠标任何造作。
- ActiveSkin控件的问题,加载了皮肤以后,TEXTBOX就无法显示了呢?
- 谁贴个用vb还原sq server数据库的源代码出来?100分立刻送上!!!!!!!!!
- 还有必要学DAO和RDO
- 关于timer的问题
- 一个跟多个区别很大吗?
Dim s$(), ss$
s = Split(Trim(Form1.Text2.Text), ",")
For i = 0 To UBound(s)
ss = Replace(Form1.Text1.Text, "," & s(i), "")
ss = Replace(Form1.Text1.Text, s(i) & ",", "")
Next i
Form1.Text3.Text = ss
End Sub
Private Sub Command1_Click()
Dim s$(), ss$
ss = Form1.Text1.Text
s = Split(Trim(Form1.Text2.Text), ",")
For i = 0 To UBound(s)
ss = Replace(ss, "," & s(i), "")
ss = Replace(ss, s(i) & ",", "")
Next i
Form1.Text3.Text = ss
End Sub结果:
13969563005,15269724228,13153955280,13326208876,13406589802
Private Sub Command1_Click()
Dim s$(), ss$
ss = Form1.Text1.Text
s = Split(Trim(Form1.Text2.Text), ",")
For i = 0 To UBound(s)
ss = Replace(ss, "," & s(i), "")
ss = Replace(ss, s(i) & ",", "")
Next i
Open App.Path & "\3.txt" For Output As #1: Print #1, ss: Close #1
End Sub
Option Explicit
' 把工程设置成从 Sub Main() 启动
Sub Main()
Dim strTextA$, strTextB$, strTemp$, i&, n%
n = FreeFile()
Open "X:\Temp\1.txt" For Binary As #n
strTextA = Space$(LOF(n))
Get #n, 1, strTextA
Close
Open "X:\Temp\2.txt" For Binary As #n
strTextB = Space$(LOF(n))
Get #n, 1, strTextB
Close
Open "X:\Temp\3.txt" For Output As #n
For i = 1 To InStrRev(strTextA, ",") - 1 Step 12
strTemp = Mid$(strTextA, i, 11)
If (InStr(1, strTextB, strTemp) = 0) Then Print #n, strTemp
Next
Close
End Sub
Open "c:\1.txt" For Input As #1
Open "c:\2.txt" For Input As #2
Open "c:\3.txt" For Output As #3
Dim f1 As String, f2 As String
Dim i As Integer, j As Integer
Dim ff1() As String, ff2() As String
Line Input #1, f1: f1 = Left(f1, Len(f1) - 1)
Line Input #2, f2: f2 = Left(f2, Len(f2) - 1)
ff1 = Split(f1, ","): ff2 = Split(f2, ",")
For i = 0 To UBound(ff1)
For j = 0 To UBound(ff2)
If ff2(j) = ff1(i) Then ff1(i) = ""
Next j, i
For i = 0 To UBound(ff1)
If ff1(i) <> "" Then Print #3, ff1(i) & ",";
Next
Close
MsgBox "ok"
End Sub
Private Sub Command1_Click()
Dim s$(), s1$, s2$, ss$
Open App.Path & "\1.txt" For Binary As #1: s1 = Trim(Input(LOF(1), #1)): Close #1
Open App.Path & "\2.txt" For Binary As #1: s2 = Trim(Input(LOF(1), #1)): Close #1
s = Split(Trim(s1), ",")
For i = 0 To UBound(s)
If 0 = InStr(s2, s(i)) Then ss = ss & s(i) & ","
Next i
Open App.Path & "\3.txt" For Output As #1: Print #1, ss: Close #1
MsgBox "ok"
End Sub
Dim s$(), s1$, s2$
Open App.Path & "\1.txt" For Binary As #1: s1 = Trim(Input(LOF(1), #1)): Close #1
Open App.Path & "\2.txt" For Binary As #1: s2 = Trim(Input(LOF(1), #1)): Close #1
s = Split(Trim(s2), ",")
For i = 0 To UBound(s)
If Trim(s(i)) <> "" Then s1 = Replace(s1, "," & s(i), "")'加上判断是否为空数组避免替换所有“,”
If Trim(s(i)) <> "" Then s1 = Replace(s1, s(i) & ",", "")
Next i
Open App.Path & "\3.txt" For Output As #1: Print #1, s1: Close #1
MsgBox "ok"
End Sub
把:Print #n, strTemp
改成:Print #n, strTemp; ",";就是你要的输出格式了。