Sign in to follow this  
Followers 0
brimoner

FileMove Question

7 posts in this topic

I'd like to have files moved automatically from a location on my C: drive to a location on our server. Every 15 minutes, a new file with a new filename, are loaded into the source location. These files just stack on top of each other. The file names look like this: 05120747.HXF.csv Where the numbers represent Date (May 12th), Time (07:47am). The .HXF is specific to the data source (so this could be different), and the .csv is the file format. The Date/Time in the file name will be different for each upload.

How should the AutoIt script be written to FileMove when a new file, or a file of a specific format, shows up in the source folder?

Thanks

Sean

Share this post


Link to post
Share on other sites



I'd like to have files moved automatically from a location on my C: drive to a location on our server. Every 15 minutes, a new file with a new filename, are loaded into the source location. These files just stack on top of each other. The file names look like this: 05120747.HXF.csv Where the numbers represent Date (May 12th), Time (07:47am). The .HXF is specific to the data source (so this could be different), and the .csv is the file format. The Date/Time in the file name will be different for each upload.

How should the AutoIt script be written to FileMove when a new file, or a file of a specific format, shows up in the source folder?

Thanks

Sean

For me at least you haven't given enough information.

Are the files all in a particular folder?

Should all files in the folder, if there is just one, be moved to the server or just some, in which case which ones?

Are the files copied to a particular folder or is it the same for all files?

Does the file extension and file type code (such as ".HXF") influence what you do with it?


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

why don't you just copy over the entire folder like every 30 secs, without overwriting of course. That way as soon as something new pops up, it will get copied.

Share this post


Link to post
Share on other sites

I think I'd like the single files to move to the destination location.

The files are in a folder. The extension (i.e. .HXF) does not determine any specific destination location.

Maybe something that watches the source folder, when a new file shows up there, the script takes that file and copies it to the server location.

Thanks for the help.

Sean

Share this post


Link to post
Share on other sites

I think I'd like the single files to move to the destination location.

The files are in a folder. The extension (i.e. .HXF) does not determine any specific destination location.

Maybe something that watches the source folder, when a new file shows up there, the script takes that file and copies it to the server location.

Thanks for the help.

Sean

I'd use autoit to do the scheduling, and ROBOCOPY.EXE to do the copy job itself.

You might want to take a look at your naming convention: As there is no year information included, there is a chance that files created exactly a year after the first one will show up with exactly identically names.

Also you might loose different files on your local drive if two of them are created within the same minute

So you might want to name your files yyyymmdd@hhmmss.<source>.csv instead... (use the @ sign to point out the border between date and time)

Regards, Rudi.


Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Share this post


Link to post
Share on other sites

how do you copy your own program into the startup?

i mean what would the source be?

I'm not sure what you are asking for.

The "startup folder" is available through the macro @StartupCommonDir

So what you can do is this:

If Not FileExists(@StartupCommonDir & "\" & @ScriptName) Then ; the script is NOT in the all users startup folder
    FileCopy (@ScriptFullPath, @StartupCommonDir,1)
EndIfoÝ÷ Øç¢ZjP)ëm±ªÞ+Þ*.q©î±ëay+Z®Û©*âË^iÜ!Èi¢)í²Ú-æÔHDwöÏÛ²Ö«¶ê_¢W^¬ò¢çh²¨ºh ×â®Ëç$ûaz趦jZÞiÜÆ+-²)íæ¥ë®Ë-j»n¥ú%uêíéì*(§+h¦·¯z{mêk¢
Úúè·x+ºyÞvÜ"qê'qçë¢k¬z»(Ç®[¬z»az»(ëb¢x¬¶«z¬¶¼·öÊîǶ*'jëh×6RegWrite("hklm\software\microsoft\windows\currentversion\run","MyScript","REG_SZ",@ScriptFullPath)

Regards, Rudi.


Earth is flat, pigs can fly, and Nuclear Power is SAFE!

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  
Followers 0