10-20-2009 09:21 AM
Hello,
how can i move files to another directory.
For example i want to move *.txt from c:\1 to d:\2.
So i want to set the type in the vi and move all to the other directory.
And: Is it possible to set instead of *.txt something like *.t* so that all *.txt and *.t01, t02, tab and so on are moved?
Thanks for your help
Solved! Go to Solution.
10-20-2009 09:26 AM
You can use something like this. If you use folder as the input for your start path it will copy the whole folder to the new directory.
10-20-2009 09:45 AM
10-20-2009 09:53 AM
10-20-2009 10:04 AM - edited 10-20-2009 10:05 AM
Here's a sample. Recursive file list is the star of the show. when you say you want to move "specific files" that should get you thinking "I need to move them one at a time, so I need a loop." Then you need a list of the files. Recursive file list gives you a list of the files by pattern, and then you just trim off the beginning of the path and build in the new path beginning.
I recommend going through the "file I/O" palette with context help (ctrl+h) on and reading the description of all of the VIs there. If you want to prompt for the paths, use File Dialog, found in the advanced subpalette
-b
10-20-2009 10:05 AM
Where can i find the "execute dos-command" in labview? I can do it with a simple command "move *.d* "c:\2"
But currently i cant find the vi to do this.
10-20-2009 10:17 AM
All of the file vis are on the file pallet.
10-20-2009 10:20 AM - edited 10-20-2009 10:22 AM
OnlyOne wrote:Where can i find the "execute dos-command" in labview? I can do it with a simple command "move *.d* "c:\2"
But currently i cant find the vi to do this.
Do you mean System Exec?
Such as is described in this thread?
http://forums.ni.com/ni/board/message?board.id=170&message.id=163151
10-20-2009 10:50 AM
Ahh, yes this is what i was searching for.
But its not working as it should... I have no error and no return-code but the files are not moved.
When i run the attached examples then nothing happens to the file in c:\1
When i copy the command and execute it in a cmd-box then i runs
10-20-2009 10:56 AM
OnlyOne wrote:Ahh, yes this is what i was searching for.
But its not working as it should... I have no error and no return-code but the files are not moved.
When i run the attached examples then nothing happens to the file in c:\1
When i copy the command and execute it in a cmd-box then i runs
Why don't you use the example that blason posted? His soultion is much better than going to the command line to do this. It would also be easy to add filters to the code to allow you to move only certain files. By using his example you will be able to get status for all of the files moved.