Fastest way to find and replace inside a large amount of files Currently I am looping through dependencies of objects, and I am trying to replace GUID (unity object ID's) inside the files. 
Right now I am using the following code, any suggestions for improvement ?

public class SendToThread
{
    public int localID = 0;
    public string oldID;
    public string newID;
    public List&lt;string&gt; dependencyAssetPath = new List&lt;string&gt;();
    public string applicationPath;
}

public void Charlie()
{
    //toUseData is a List&lt;SendToThread&gt;
    for (int i = 0 ; i &lt; toUseData.Count; i++)
    {
        while (toUseData[i].dependencyAssetPath.Count &gt;= 1)
        {
            string[] lines = File.ReadAllLines(toUseData[i].applicationPath + toUseData[i].dependencyAssetPath[0]);

            for (int e = 0; e &lt; lines.Length; e++)
            {
                DebugVoid(lines.Length.ToString());
                lines[e].Replace(toUseData[i].oldID.ToString(), toUseData[i].newID.ToString());

                if (e == lines.Length - 1)
                {
                    DebugVoid(toUseData[i].oldID.ToString() + "  " + toUseData[i].newID.ToString());
                    File.WriteAllLines(toUseData[i].applicationPath + toUseData[i].dependencyAssetPath[i], lines);
                }
            }
            toUseData[i].dependencyAssetPath.RemoveAt(0);
        }
    }
}
Building on what Heslacher and Magus have said:

You should not make publically accessible non-readonly collections. So I've converted those to readonly collections. It didn't appear to change how you were accessing them anyway.

I've also swapped your outermost for loop for a foreach, which makes the code slightly cleaner and I've swapped your while loop for a foreach, because it appears to just be iterating over the collection. However this assumes that

File.WriteAllLines(toUseData[i].applicationPath + toUseData[i].dependencyAssetPath[i], lines);


is a bug and should instead be

File.WriteAllLines(toUseData[i].applicationPath + toUseData[i].dependencyAssetPath[0], lines);


If not, then the while loop should be used.

Resulting version:

public class SendToThread
{
    private int localId = 0;
    public int LocalID
    {
        get{ return localId;}
        set{ localId = value;}
    }
    public string OldID {get; set;}
    public string NewID {get; set;}
    private readonly List&lt;string&gt; dependencyAssetPath = new List&lt;string&gt;();
    public List&lt;string&gt; DependencyAssetPath
    {
        get{ return dependencyAssetPath;}
    }
    public string ApplicationPath {get; set;}
}

public void ReadAssets()
{
    //toUseData is a List&lt;SendToThread&gt;
    foreach(var toUse in toUseData)
    {
        foreach(var assetPath in toUse.DependencyAssetPath)
        {
            string[] lines = File.ReadAllLines(toUse.ApplicationPath + assetPath);

            for (int e = 0; e &lt; lines.Length-1; e++)
            {
                DebugVoid(lines.Length.ToString());
                lines[e].Replace(toUse.OldID, toUse.NewID);
            }

            DebugVoid(toUse.OldID + "  " + toUse.NewID);
            File.WriteAllLines(toUse.ApplicationPath + assetPath, lines);
        }
        toUse.dependencyAssetPath.Clear();
    }
}