java - Create a directory based on this month and move dirs to it -


I am thinking of writing a program that will transfer some newly created DIR to the other, which will give them date-stamp folders Puts in; Either I can write / debug / test in Java for 1.5 hours a month or a month or a year, but

I would like to know that someone else has to deal with it. And maybe it can use windows batch script, or anything else i just do.

Edit : It has been found that I did not tell my requirements adequately. Better Requirements:

  • The folders that are created should be copied to the folder in the name of one month at present. This is important because new folders are being created every day, and if I always copy all from the source dial to the printed diaries in the month, then I will send the last month's file to this month's folder I will copy Besides, copying files in Source DIR after copy is also a bad option, because files are being streamed, so for some time delete the file in the Source DIR.
  • Is being written for

From the command prompt:

  for / f "tokens = 3 delims = / "% f in ('date / t') md% f & amp; Xcopy Source \ xyz *% F  

Date of this order / t

  C: \ & gt; By using  

delimters / and space

and / or

Mon, 19, 10, 2009

Then you are asked to get the third token (10) which is on my system month

After parsing% F (which becomes 10 to create a directory), and by using and we add one to execute another command (i.e. xcopy in new directory).

Another example to make it a bit easier is

  C: \ & gt; For / f "tokens = 2"   
  3,4 delimits = / "in% F ('date / t') @acio year =% h, month = Edit this: This is not the ideal solution to reflect comments because the date formatting is very user-centric (%), date =% F Year = 200 9, month = 10, day = 19  

Settings are based on preferences. However this clarifies the point and you should check it before using this exact code.


Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -