Skip to content

Instantly share code, notes, and snippets.

@swasheck
Created June 1, 2012 15:01
Show Gist options
  • Save swasheck/2852756 to your computer and use it in GitHub Desktop.
Save swasheck/2852756 to your computer and use it in GitHub Desktop.
Inject GO
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace file_edit
{
class Program
{
static void Main(string[] args)
{
List<string> file = System.IO.File.ReadAllLines("C:\\OutFile.txt").ToList<string>();
Console.WriteLine("Loaded File ...");
for (int i = 0; i < file.Count; i++)
if ((i % 10000 == 0))
{
file.Insert(i, "GO");
Console.WriteLine("Line {0}: Injected GO", i);
}
Console.WriteLine("Writing file ...");
System.IO.File.WriteAllLines("C:\\OutFileMod.txt", file.ToArray());
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment