Created
May 28, 2015 13:57
-
-
Save matt40k/2a272b3edf5eeb0a70b0 to your computer and use it in GitHub Desktop.
Rename the census export files so it can be loaded into Capita One
This file contains 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; | |
namespace BulkRename | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
string inputDir = Properties.Settings.Default.InputDirectory; | |
string outputDir = Properties.Settings.Default.OutputDirectory; | |
string inputFile = Properties.Settings.Default.InputFile; | |
string outputFileSuffix = Properties.Settings.Default.OutputFileSuffix; | |
foreach (string folder in Directory.GetDirectories(inputDir)) | |
{ | |
string estNo = folder.Substring((folder.Length - 7)); | |
Console.WriteLine("Processing: " + estNo); | |
File.Copy(Path.Combine(folder, inputFile), Path.Combine(outputDir, estNo + outputFileSuffix)); | |
} | |
Console.WriteLine("Finished, press any key to exit."); | |
Console.ReadKey(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment