View previous topic :: View next topic |
Author |
Message |
VincentMagnotta
Joined: 28 Jul 2008 Posts: 46
|
Posted: Mon Jan 24, 2011 6:15 pm Post subject: Copy issues |
|
|
So the requirement is that we COPY a file to a new name. The rename functionality doesn't appear to work unless we're using RENAME but then the file gets MOVED instead of COPIED (the original no longer exists!).
How can we accomplish our original goal? |
|
Back to top |
|
 |
Robert Site Admin
Joined: 25 May 2006 Posts: 1140
|
Posted: Wed Jan 26, 2011 3:27 pm Post subject: |
|
|
give an example of source filename and required target filename.
is target file going to be located in same folder as source file? |
|
Back to top |
|
 |
VincentMagnotta
Joined: 28 Jul 2008 Posts: 46
|
Posted: Thu Jan 27, 2011 4:17 pm Post subject: copy with new name |
|
|
Quote: |
give an example of source filename and required target filename.
is target file going to be located in same folder as source file?
|
Different folders (even different file systems in this case, but it didn't work within the same fs either). In this example the source file is named myfile.dat
from: D:\src\directory
target: \\outputserver\outputpath
copy name: myfile
rename: newname
If I use RENAME then:
I'd expect to see \\outputserver\outputpath\newname.dat and I do! Problem is that the original myfile.dat has disappeared.
If I use COPY:
I end up with \\outputserver\outputpath\myfile.dat and the original is still there.
So either it applies the rename but I lose the original or it applies the copy but won't rename. Seems like RENAME --> MOVE
Any ideas? |
|
Back to top |
|
 |
VincentMagnotta
Joined: 28 Jul 2008 Posts: 46
|
Posted: Mon Jan 31, 2011 9:34 am Post subject: any ideas at all |
|
|
Any reaction? It's been days. |
|
Back to top |
|
 |
melvin Site Admin
Joined: 25 May 2006 Posts: 635 Location: Santa Barbara, california
|
Posted: Tue Feb 01, 2011 7:24 pm Post subject: |
|
|
The copy mode ignores the rename field, and only supports the append filename field.
Your only option is to do a copy task followed by a rename task of the copied file. |
|
Back to top |
|
 |
VincentMagnotta
Joined: 28 Jul 2008 Posts: 46
|
Posted: Wed Feb 09, 2011 9:18 am Post subject: |
|
|
That seems like a missing feature to me. Since most of these tasks are generated, we now need to generate extra steps for every chain where we want rename-on-copy and it's not that rare. |
|
Back to top |
|
 |
VincentMagnotta
Joined: 28 Jul 2008 Posts: 46
|
Posted: Wed Feb 09, 2011 10:43 am Post subject: One more question |
|
|
Is there a way to get a file list (preferably in a format usable by Copy) of the results of RENAME?
So MyRenameTask renames 5 files. I want to pass that list to MyCopyTask. Is there a way to extract that list as a variable?
I have multiple environments with different versions of Automize. I'm hoping for a cross-version solution but even a solution that only works in 9.0 would leave me ahead of where I am right now.
Thanks! |
|
Back to top |
|
 |
Robert Site Admin
Joined: 25 May 2006 Posts: 1140
|
Posted: Thu Feb 10, 2011 5:09 pm Post subject: |
|
|
The copy task did not have a Filenames variable. Large amounts of filenames messed up the variable file.
In 9.03+ , there is an array variable:
ARRAY--TaskTitle--CopiedFiles
You would have to use the 'array to filename' task to convert this array variable into a regular filenames variable. |
|
Back to top |
|
 |
VincentMagnotta
Joined: 28 Jul 2008 Posts: 46
|
Posted: Tue Feb 15, 2011 9:02 am Post subject: buggy variable |
|
|
So, in the windows world that variable formats incorrectly because it doesn't escape the backslashes properly:
Code: |
cba_transaction.txt | D:runCBA_INS_GM_SC20110214cba_transaction.txt | D:runCBA_INS_GM_SC20110214
|
The file path above (cell 2) is actually:
Code: |
D:\run\CBA_INS_GM_SC\20110214\cba_transaction.txt
|
|
|
Back to top |
|
 |
Robert Site Admin
Joined: 25 May 2006 Posts: 1140
|
Posted: Thu Feb 17, 2011 8:42 am Post subject: |
|
|
How are you using this variable?
Just tested and I had no problems with it. |
|
Back to top |
|
 |
VincentMagnotta
Joined: 28 Jul 2008 Posts: 46
|
Posted: Thu Feb 17, 2011 12:39 pm Post subject: |
|
|
Quote: |
How are you using this variable?
Just tested and I had no problems with it. |
Either in the UI or testing it with Echo.
Since I couldn't get it display properly I'll admit I haven't tried using it in too many other places. |
|
Back to top |
|
 |
|