你好,我的名字是丹尼斯,我有以下目录IMAGES\
:
EX0010040324303-001.tif
EX0010040324303-002.tif
EX0010040324303-003.tif
EX0020943843934-001.tif
EX0020943843934-002.tif
EX0030673452099-001.tif
EX0030673452099-002.tif
我想要什么?
遍历目录并编译文本文件,如下所示:
EX0010040324303,,IMAGES\EX0010040324303-001.tif,Y,,,3
EX0010040324303,,IMAGES\EX0010040324303-002.tif,,,,
EX0010040324303,,IMAGES\EX0010040324303-003.tif,,,,
EX0020943843934,,IMAGES\EX0020943843934-001.tif,Y,,,2
EX0020943843934,,IMAGES\EX0020943843934-001.tif,,,,
EX0030673452099,,IMAGES\EX0030673452099-001.tif,Y,,,2
EX0030673452099,,IMAGES\EX0030673452099-002.tif,,,,
因此:DocId2,,DocId,Y,,,NumberOfPages 用于文档的第一个 tif 页面,DocId2,,DocId,,,, 用于文档的其他 tif-ages
目前,我制作了以下脚本:
Function readCompleteText(inputReadLocation, OutputwriteLocation)
Const ForReading = 1
Dim lenInputReadLocation
Dim docId
Dim docId2
Dim oStream
Dim translationFileContents
Dim inputText
lenInputReadLocation = LEN(inputReadLocation)
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set FileList = objWMIService.ExecQuery _
("ASSOCIATORS OF {Win32_Directory.Name='"& inputReadLocation &"'} Where " _
& "ResultClass = CIM_DataFile")
For Each objFile In FileList
Dim i
i = 0
docId = RIGHT(objFile.Name,(LEN(objFile.Name)-lenInputReadLocation-1))
docId2 = LEFT(docId, LEN(docId)-4)
MyArray = Split(docId2, "-")
EXnumber = MyArray(0)
PageNumber = MyArray(1)
'inputText = EXnumber &",,"& docId &",,,,"
Next
oStream.WriteText inputText,0
oStream.SaveToFile OutputwriteLocation
oStream.close
oStream = Nothing
End Function
我的问题是:
- 如何计算每个文档的页数?
- 如上所示,如何使用图像的文件名编写文本文件。
任何帮助是极大的赞赏 :-)