Move a file, in alphabetical order
Moderators: Dorian (MJT support), JRL
Move a file, in alphabetical order
Me again.
Ok. I have looked for many move file topics and I can now move all the files within a directory.
But a question remains:
I have a directory of files.
Let's say DirectoryA with File1, File2 and File3.
DirectoryA
File1
File2
File3
What I need to do is move the first file, File1 to Directory B, then File2, then File3.
The order is important. Now, there are a lot of commands like filedate, filesize, filetime, but me, I need to move files by filenames! I mean the first one in the directory, then the 2nd one, etc.
let's assume that I cannot rename the files.
Once I have my 'files' variable filled in with my file names how can I send the first one in the list ? Is there an index I can used with the GetFileList command ?
GetFileList>%BeaconFolder%*.txt,files
Separate>files,;,file_names
Let>k=0
Repeat>k
Let>value=filename_%k% -> I would like to NOT use that line
Thanks
Ok. I have looked for many move file topics and I can now move all the files within a directory.
But a question remains:
I have a directory of files.
Let's say DirectoryA with File1, File2 and File3.
DirectoryA
File1
File2
File3
What I need to do is move the first file, File1 to Directory B, then File2, then File3.
The order is important. Now, there are a lot of commands like filedate, filesize, filetime, but me, I need to move files by filenames! I mean the first one in the directory, then the 2nd one, etc.
let's assume that I cannot rename the files.
Once I have my 'files' variable filled in with my file names how can I send the first one in the list ? Is there an index I can used with the GetFileList command ?
GetFileList>%BeaconFolder%*.txt,files
Separate>files,;,file_names
Let>k=0
Repeat>k
Let>value=filename_%k% -> I would like to NOT use that line
Thanks
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
You just need to sort the array:
http://www.mjtnet.com/forum/viewtopic.php?t=3414
http://www.mjtnet.com/forum/viewtopic.php?t=4063
They will then be in alphabetical order and you can go down from top to bottom in the usual way, by index.
http://www.mjtnet.com/forum/viewtopic.php?t=3414
http://www.mjtnet.com/forum/viewtopic.php?t=4063
They will then be in alphabetical order and you can go down from top to bottom in the usual way, by index.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Well, you already posted the code to do that but for some reason you say you don't want to do it:
Let>item=file_names_1
Let>item=file_names_1
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
That question occured to me too. Since the order files are copied will make no difference to the order they are stored, or seen. So I assumed the op just wants to copy the first one or few - alphabetically. If copying the lot there is absolutely no point in doing it in any order.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
Ok works now.
The order is important because they are distress beacon files. So they have to be sent (moved) as they come in. In a real system, they come in one at a time and the system read them one at a time.
In testing, when I 'replay' the thing, I have all my beacon text files in a folder and I need to send them in order they would arrive in reality. When the files arrive, their filename contains text but also a unique number that is incremented for each file.
Regards.
The order is important because they are distress beacon files. So they have to be sent (moved) as they come in. In a real system, they come in one at a time and the system read them one at a time.
In testing, when I 'replay' the thing, I have all my beacon text files in a folder and I need to send them in order they would arrive in reality. When the files arrive, their filename contains text but also a unique number that is incremented for each file.
Regards.
Hi lebrocoli,Me_again wrote:Can you tell us why the order in which the files are copied is important?
I was curious about this too. Are you concerned with what order they might appear when you do some sort of directory listing or... is it something to do with the actual Creation Dates of the copied files or...?
jpuziano
Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post -
Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post -
-
- Automation Wizard
- Posts: 1101
- Joined: Fri Jan 07, 2005 5:55 pm
- Location: Somewhere else on the planet
Understood, thanks for the info!lebrocoli wrote:The order is important because they are distress beacon files. So they have to be sent (moved) as they come in. In a real system, they come in one at a time and the system read them one at a time.
In testing, when I 'replay' the thing, I have all my beacon text files in a folder and I need to send them in order they would arrive in reality. When the files arrive, their filename contains text but also a unique number that is incremented for each file.
Regards.