Created
April 23, 2015 06:43
-
-
Save kaorun55/e7a9606444006085bdfa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.IO; | |
| using System.Reflection; | |
| namespace Rename | |
| { | |
| class Program | |
| { | |
| static void Main( string[] args ) | |
| { | |
| int begin = 46; | |
| int end = 145; | |
| var path = Path.GetDirectoryName( Assembly.GetEntryAssembly().Location ); | |
| Console.WriteLine( path ); | |
| var sourcePath = Path.Combine( path, "original" ); | |
| var targetDir = "renamed"; | |
| var targetPath = Path.Combine( path, targetDir ); | |
| Directory.CreateDirectory( targetDir ); | |
| for ( int i = begin; i <= end; i++ ) { | |
| var sourceFileName = Path.Combine( sourcePath, string.Format( "R0010{0:000}.JPG", i ) ); | |
| var targetFileName = Path.Combine( targetPath, string.Format( "R{0:0000}.JPG", i - begin ) ); | |
| File.Copy( sourceFileName, targetFileName ); | |
| } | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment