Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: Help with a script mask Change Date > 7 days ago, ignore filename case and character change

You hardly do with with simple WinSCP scripting.

Though, it should be rather easy to implement in PowerShell script with a use of WinSCP .NET assembly.
https://winscp.net/eng/docs/library_powershell
bcgrossman@...

Help with a script mask Change Date > 7 days ago, ignore filename case and character change

I am trying to create a file transfer with some peculiar rules and can't seem to picture how to do it.

In the remote directory I have files named J_YYYYMMDDHHNN_PARTA where YYYY=year, MM=Month, DD=day,HH=Hour, and NN=Minutes.
In the local directory, the file names are:J_YYYYMMDDHHNN.PartA where YYYY=year, MM=Month, DD=day,HH=Hour, and NN=Minutes.

The remote directory has files back as far as 2013. So I only want to look at files that are 7 days old or younger (today-7 days).

I want to ignore upper case/lower case differences.

And I need to ignore the character change where the second underscore ('_') becomes a period (dot, '.').

Since I don't know when the file will show up on the remote, I need to run the job every few minutes from 3:00am to 5:00am.
That's why I need to not download files that have already been downloaded.

The problem is that when the file is first downloaded, it triggers a local process that changes the second underscore character (and for some reason the case of the characters in 'PART') to a dot.

The dot is the only way the local process has of knowing that it has already processed the file.

Is there a way to do this in a script?

Thank you for your help.

barry