Results 1 to 5 of 5

Thread: Rename multiple file types

  1. #1
    Join Date
    Feb 2009
    Posts
    78

    Rename multiple file types

    hello,

    I have several file type 2003_050
    With the year 2003 and the day 050 days of the year, making March 19.
    I want to use a program to convert all my file number in dd / mm / yyyy.

    Thank you for your reply

  2. #2
    Join Date
    Dec 2008
    Posts
    69

    Re: Rename multiple file types

    Frankly, I rather recommend yyyy-mm-dd format (for correct sorting in Explorer).

    But apart from that, no, I do not know of any program for that.

  3. #3
    Join Date
    Feb 2009
    Posts
    78

    Re: Rename multiple file types

    Yes you're right but no matter what the format is essential to make the conversion.
    Thanks for your suggestion.

  4. #4
    Join Date
    Mar 2008
    Posts
    227

    Re: Rename multiple file types

    For the conversion you can do like this:

    conv.bat
    Code:
     @ echo off 
    
      set example = 2003_050 
    
      :: Extraction of the Year 
      set A =% EXAMPLE: ~ 0.4% 
    
      :: Extraction of Quantième 
      set / a Q = 1% EXAMPLE: ~ 5,3% - 1000 
    
      :: Calculation of Julian day from 1 January of the year%% A +% Q% days 
      set / a = JJ% Q% + ((1461 * (% A +% 4800 + (1 - 14) / 12)) / 4 + (367 * (1 - 2 - 12 * ((1 - 14) / 12 ))) / 12 - (3 * ((%% A + 4900 + (1 - 14) / 12) / 100)) / 4 + 1 - 32075) - 1 
    
      :: Convert Julian Day to Day (% J%), Month (M%%) and Year (% A%) 
      set / a T0 =% DD% + 68569 
      set / a T1 = (T0 *% 4%) / 146097 
      set / a T0 = T0%% - (146097 *% Q1% + 3) / 4 
      set / a T2 = (4000 * (%% T0 + 1)) / 1461001 
      set / a T0 = T0%% - (1461 *% Q2%) / 4 + 31 
      set / a T3 = (80 *% T0%) / 2447 
      set / a J = T0%% - (2447 *% Q3%) / 80 
      set / a M =% Q3% + 2 - (12 * (% Q3% / 11)) 
      set / a A = 100 * (% Q1% - 49) +% +% Q2 (% T3% / 11) 
    
      :: Formatting resultat 
      if% J% LSS 10 set J = J% 0% 
      if% M% LSS 10 set M = M% 0% 
    
      echo. 
      Before conversion echo:%% EXAMPLE 
      echo after conversion:% A% M% _% _% J% 
      echo.  & Pause
    Result
    Before conversion: 2003_050
    After conversion: 2003_02_19

    Press any key to continue ...

  5. #5
    Join Date
    Feb 2009
    Posts
    78

    Re: Rename multiple file types

    I thank you for your answer but I am not programming savvy therefore you can tell me how to run this program (with what software);
    On the other hand is what the code you have given m I can directly rename a file or I have to do an extra manipulation?

    Actually I managed to run the script by creating a bat file. But how I do I do if I want to rename the file name.

    Thank you for your answer

Similar Threads

  1. Rename Multiple Files
    By ismart in forum Tips & Tweaks
    Replies: 1
    Last Post: 11-05-2011, 12:43 AM
  2. Replies: 3
    Last Post: 23-06-2010, 02:57 AM
  3. Multiple generic types in java
    By Maya Angelou in forum Software Development
    Replies: 5
    Last Post: 11-03-2010, 01:11 PM
  4. Method with multiple return types
    By ISAIAH in forum Software Development
    Replies: 5
    Last Post: 25-02-2010, 05:10 AM
  5. Software to rename multiple files
    By Elijah in forum Windows Software
    Replies: 5
    Last Post: 04-03-2009, 08:11 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,717,389,233.88098 seconds with 16 queries