February 14, 2002 at 2:40 pm
Hi, all
I have a Q for U:-)))
I have a Active X script that makes Header & Trailer into the data text file. U can check my other discussion:-)))
My Q is , how can I put data text record count in the trailer?
What I mean by that is how can I count records that are in text file?
I used COUNT method in Active X script but it did not work?
Any idea????
Thx in advance..
Jay
February 28, 2002 at 12:31 pm
I don't know if this will help, but here's what I did:
'Count Records in Datafile
Set FSO = CreateObject("Scripting.FileSystemObject")
Set lfInputFile = FSO.GetFile(vPath&"\yourfilename")
Set ltsInput = lfInputFile.OpenAsTextStream(ForReading)
I=0
Do While Not ltsInput.AtEndOfStream
lsTemp = ltsInput.ReadLine
I = I+1
Loop
ltsInput.Close
Set ltsInput = Nothing
Set lfInputFile = Nothing
This enabled me to do a count of all the rows for inclusion in my trailer record.
Edited by - ncaffee on 02/28/2002 12:40:05 PM
February 28, 2002 at 1:42 pm
If they are fixed length rows you could subtract out the byte count for header and trailer, then divide remainder by the row length.
Andy
February 28, 2002 at 2:10 pm
Another option which might be a little overkill, would be to use the odbc text driver to access the file as a recordset. Then just check the value of the record count property.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy