Created
June 1, 2012 15:01
-
-
Save swasheck/2852756 to your computer and use it in GitHub Desktop.
Inject GO
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.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