Skip to content

Instantly share code, notes, and snippets.

@matt40k
Created May 28, 2015 13:57
Show Gist options
  • Save matt40k/2a272b3edf5eeb0a70b0 to your computer and use it in GitHub Desktop.
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
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