Forum Discussion

deepakgtm's avatar
deepakgtm
New Contributor
12 years ago

Counting Records from a pipe separated text file

I want to use test complete to count the number of records from a pipe separated text file. Any help would be great.



Thanks

Deepak

2 Replies

  • sastowe's avatar
    sastowe
    Super Contributor
    Pipe separated text file means that there is one line (up to a carriage return line feed)? Take a look at the aqFile object. It has an OpenTextFile method. You can open the file, read the line and then



    asSomeVar = Split(sWhateverYouReadIn, "|")





    iNum = UBound(asSomeVar)
  • Hi,


    I think, the aqFile and aqString objects will be useful for your task. You can get a string containing a text from the text file using the aqFile.ReadWholeTextFile method, then specify the pipe separator using the aqString.ListSeparator property and get a number of records separated by the pipe using aqString.GetListLength.


    Please refer to help system for the full description of these properties and methods. I hope this information helps.

    Ann