Aller au contenu principal

Recherche

Recherche

Record Count

Commentaires

1 commentaire

  • Avatar
    Domingo Rodriguez
    Modérateur
    This seems more to be a general VBScript programming question, more than a BarTender related problem, but I've found the following VBScript code which will count the number of lines of a certain text file. I hope this helps:

    const filename="abc_test.txt" 'make your input
    set fso=createobject("scripting.filesystemobject")
    set ofile=fso.opentextfile(filename)
    strcontents=ofile.readall
    ofile.close
    set ofile=nothing
    set fso=nothing
    acontents=split(strcontents,vbcrlf)
    wscript.echo "Number of line : " & cstr(ubound(acontents)+1)

    Instead of writing to the screen, the last line of your VBScript could be:

    value = cstr(ubound(acontents)+1)

    Hope this helps.
    0

Vous devez vous connecter pour laisser un commentaire.