using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.IO; using System.Text.RegularExpressions; namespace ReJSONify { class Program { static void Main(string[] args) { string photos = File.ReadAllText(@"C:\Documents and Settings\Kalrac\Application Data\Flickr\Flickr Uploadr\Profiles\4ro4tsrx.default\replacementphotos.json"); photos = Regex.Replace(photos, "guid\\:\"........-....-....-....-............\"", "guid:null"); //You can't just do a single replace, as each GUID needs to be different. for (int index = photos.IndexOf("guid:null"); index < photos.Length && index != -1; index = photos.IndexOf("guid:null")) { photos = photos.Remove(index, "guid:null".Length); photos = photos.Insert(index, "guid:\"" + Guid.NewGuid().ToString("D") + "\""); } File.WriteAllText(@"C:\Documents and Settings\Kalrac\Application Data\Flickr\Flickr Uploadr\Profiles\4ro4tsrx.default\replacementphotos.json", photos); Console.WriteLine(photos); Console.ReadLine(); } } }