Jump to content

File Count Up


Recommended Posts

The real question is...why DOES this work???

$Count = 1

$SecondaryCapturePath = "\\10.0.0.200\PhoneReport\phone" & $Count & ".txt"

I am trying to get a file to count up but it won't work. Is this not proper coding? If not can someone help me to how to fix this. This is what I get every time I try to run it.

$SecondaryCapturePath = "\\10.0.0.200\PhoneReport\phone" & $Count ".txt"

$SecondaryCapturePath = ^ ERROR

>Exit code: 1 Time: 0.452

Link to comment
Share on other sites

I am trying to get a file to count up but it won't work. Is this not proper coding? If not can someone help me to how to fix this. This is what I get every time I try to run it.

$SecondaryCapturePath = "\\10.0.0.200\PhoneReport\phone" & $Count ".txt"

$SecondaryCapturePath = ^ ERROR

>Exit code: 1 Time: 0.452

Basically, a file CANNOT count ... <_<

Assuming your path is correct (accepted by the OS), you still need an "&" before ".txt".

If you are storing the value "$Count" inside a file, the key command is 'FileWrite ( filehandle or "filename", "line" )'

If you are trying to count something, there needs to be something like

$Count +=1
before storing the new value.

If you just want a count of files in a path, '_FileListToArray ( $sPath [, $sFilter [, $iFlag]] )' will have the count result in $array[0]. Here isan excerpt from the Help file:

The array returned is one-dimensional and is made up as follows:

$array[0] = Number of Files\Folders returned

$array[1] = 1st File\Folder

$array[2] = 2nd File\Folder

$array[3] = 3rd File\Folder

$array[n] = nth File\Folder

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...