1、dir递归查找当前文件夹下的每一个文件。
2、open打开文件,line input读到第10
3、left、right、mid等找出行关键字。
4、fielcopy、kill等语句移动文件
2、open打开文件,line input读到第10
3、left、right、mid等找出行关键字。
4、fielcopy、kill等语句移动文件
解决方案 »
- 关于Excel.Application关闭
- 在Vista下 VB6.0 用不了 FileCopy 命令!!!!! 帮忙!!!
- Load完后,再UnLoad,怎么使控件数组的下标再从1开始?
- 【问】简单的,如何直接启动一个快捷方式指向的可执行文件,并传递参数给它?
- 知道listview.SelectedItem.Key的值,如何去掉listview里相应的行?
- 字符串读取分析问题(很急高手快来帮忙谢谢各位乡亲)
- 变量问题,有兴趣的来看一看。
- 菜鸟散分!关于日期问题?请指教!
- 窗体复制问题
- 用什么语句将整个文件夹copy 到另一盘符中
- 用户sa登陆失败,with块变量未定义,求大神指导
- vb dll 问题求救!
Dim strFile As String, strData As String, strLine As String
Dim strKeywords As String, strPath As String
Dim i As IntegerstrPath = "C:\text\"
strKeywords = "AIRUDQF"'Prepare the Subdirectories
For i = 1 To 7
If Dir(strPath & Mid(strKeyword, i, 1), vbDirectory) = "" Then MkDir strPath & Mid(strKeyword, i, 1)
Next istrFile = Dir(strPath & "*.txt")
Do Until strFile = ""
Open strPath & strFile For Input As #1
strData = Input(LOF(1), #1)
Close #1
strLine = Split(strData, vbCrLf)
For i = 1 To 7
If InStr(strLine(9), Mid(strKeywords, i, 1)) Then
Name strPath & strFile As strPath & Mid(strKeywords, i, 1) & "\" & strFile 'Move the file into subdirectory
Exit For
End If
Next i
strFile = Dir()
Loop