Help with using filename parameters in script

Hi;

I’m extracting some employee data from an old notes database and putting it into a text file. I’m using the employee number to create the filename. Unfortunately, I have multiple employee numbers input in the notes database as “00000” or five zeroes.

Is there anyway in the script for me to query if the filename already exists and if it does to append a number in sequence, eg “000001” then “000002” so that i dont keep overwriting the files it sees as “00000”?

What would be the syntax for such an operation. I’ve been all over help but i cant seem to find a solution.

Please help…

Thanks

LP

Subject: Help with using filename parameters in script

Can you use a new numbering system?

It’s going to get very confusing if you have some employees on a 5-digit sequential ID and others on a separate 6-digit series. A new numbering series would ensure that any other duplicates are ruled out.

If you can’t, I’d look at using a list to see if which ids you have already encountered-

if not iselement(myList(idNumber)) then

myList(idNumber) = “”

uniqueID = idNumber

else

myList(idNumber & counter) = “”

counter = counter + 1

uniqueID = idNumber & counter

end if

HTH

Andrew

Subject: Help with using filename parameters in script

Try something like this

tmpFileName = Dir$( fileName, 0 )

If tmpFileName <> “” Then

’ your file already exists.

End If