Jump to content

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



Link to post
Share on other sites

This should be in the support forum :D but any way, post your existing code and Id be glad to help you work off that.

_____________________________________________________"some people live for the rules, I live for exceptions"Wallpaper Changer - Easily Change Your Windows Wallpaper

Link to post
Share on other sites

This forum is for finished scripts that you want to show to other people. Please post this in the Support forum.

Don't take my pic to serious...~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~You Looked, but you did not see!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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)



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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...