Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
batch file rename?
17-04-2011, 05:58 PM
Post: #1
batch file rename?
Can anybody assist with a little bit of code i need a hand with

im trying to automate a process were a csv file is automatically or periodically renamed as a xls file to another directory whilst maintaining the integrity of the original csv file.

i have a system that automatically logs values (in this scenario temperature plots to a csv file every 15 mins) I need to be able to 'on the fly' have this file converted and saved to a different directory once the csv has been updated.

been playing around with bat/cmd file using the rename command but have not achieved the goal yet

cheers

24 hours in a day, 24 beers in a case, coincidence!
Send this user an email Visit this user's website Find all posts by this user
Quote this message in a reply
17-04-2011, 07:34 PM (This post was last modified: 17-04-2011 09:08 PM by skipjack.)
Post: #2
RE: batch file rename?
got it working using xcopy and ren commands. it was the directory structure path names that was a issue, had to include " " in the spaces Smile

then use windows scheduler to automate
doh! it works once then doesn't overwrite the *.*xls file again?

the csv file is copied every time and overwrite the previous version but the ren command doesn't seem to update the file as it see it as already been created Sad

i need someway of it forcing it to create the file even if the *.*xls exists


update: i think ive finally solved it using
XCOPY C:\test\test4.csv C:\test\out" "me\ /Y
DEL C:\test\out" "me\test4.xls /Q
REN C:\test\out" "me\test4.csv test4.xls

24 hours in a day, 24 beers in a case, coincidence!
Send this user an email Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump: