infor.com
concierge
infor u
developer portal
Home
Groups
Process Automation (IPA) Community
Move file via cmd node
unknown
Has anyone used the cmd node to move a file to another directory?
Thanks,
Find more posts tagged with
Process Automation (IPA) - General Discussions
Accepted answers
unknown
I used mv {filepath} {newfilepath} and that worked. I now need to rename the file from file.txt to file{date}.txt
Any ideas?
Thank you,
unknown
In addition to mv, the cp (copy) command will work in the syscmd node as well. You can copy the file to a new directory with a new name. If you want to add a datetimestamp, create a variable which contains the stamp and use it as part of the new file name in the cp or mv command.
All comments
unknown
I used mv {filepath} {newfilepath} and that worked. I now need to rename the file from file.txt to file{date}.txt
Any ideas?
Thank you,
rmbell
We have, but DOS commands work on ours also as we are Windows, so we can either use move oldfilepatholdname to newfilepath
ewfilename, or ren oldfile newfile.
unknown
In addition to mv, the cp (copy) command will work in the syscmd node as well. You can copy the file to a new directory with a new name. If you want to add a datetimestamp, create a variable which contains the stamp and use it as part of the new file name in the cp or mv command.
unknown
I just wanted to add to this...
For just a simple date stamp of the day, I use...
DateStamp = DateString(today(),yyyymmdd');
To have the hours and minutes added, "hhmm" in ( needed for more than 1 run in a day) I think it's best to use the format date so there is no space " " in the file name and then no quotes needed for the command line.
Use DateStamp = format.formatDate(dateString, "yyyyMMddHHmm") making sure to use capitol "MM" for months or you will get back the minutes if using lowercase.
Then using the mv command {filepath} {newfilepath} You can use the new filepath to change the name of the file to whatever you want, it does not need to match the original for name. E.g.
mv {filepath} {<!newfilepath>/<!newFileName><!DateStamp>.txt}
note: the default variable is DateString(jsDate,'yyyymmdd hhmmss') and if you look at the pflow.js you can see the space is coded in... retVal = yyyy + MM + dd + ' ' + hh + min + ss;
annoying if you ask me...
Quick Links
All Categories
Recent Posts
Activity
Unanswered
Groups
Help