Jump to content
Sign in to follow this  

Filename comparisons/manipulation

Recommended Posts

I am in the process of writing a script that will automoatically ftp files from a specific directory to a ftp server - however, the directory contains files with the following names - h*.txt or l*.txt - I have no problem secluding those files from the rest in the script but I need to add a check to make sure that for every H8.txt files there is a matching l*.txt file.

For example:

Directory contains: htesting.txt

script must check for the existance of the matching l file: ltesting.txt

If the matching L file doesnot exist, I can just throw a warning and exit the program.

Any insite on how that would be accomplished would be very helpfull



Share this post

Link to post
Share on other sites

Sorry - it can be moved if neccessary. In the meain time I think I figured it out:

While 1

$hfilename = FileFindNextFile($search_filecheck)

If @error Then ExitLoop

$stripped_filename = StringTrimLeft($hfilename, 1)

$stripped_filename = StringTrimRight($stripped_filename, 4)

$lfilename = "l"&$stripped_filename&".txt"

$check = FileExists($local_sfaorders&$lfilename)

If $check = 0 Then

GUICtrlSetData ($myedit, $hfilename &" missing "& $lfilename &" match!"& @CRLF,1)



Share this post

Link to post
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
Sign in to follow this  

  • Create New...