#include int main (int argc, char **argv) { NSProcessInfo *proc; NSArray *args; NSAutoreleasePool *pool; NSMutableDictionary *oldDict, *newDict, *tempDict; NSString *nfname; NSArray *fvArray, *svArray; NSMutableArray *words; int i=0; pool = [NSAutoreleasePool new]; proc = [NSProcessInfo processInfo]; args = [proc arguments]; if([args count] < 2) { NSLog(@"I think you forgot to specify the two necessary filenames"); [pool release]; exit(0); } oldDict = [NSMutableDictionary dictionaryWithContentsOfFile: [args objectAtIndex: 1]]; nfname = [NSString stringWithString: [args objectAtIndex: 2]]; newDict = [NSMutableDictionary dictionaryWithCapacity: 1]; fvArray = [NSArray arrayWithArray: [oldDict allKeys]]; svArray = [NSArray arrayWithArray: [oldDict allValues]]; words = [NSMutableArray arrayWithCapacity: 1]; [newDict setObject: [NSDictionary dictionaryWithObjectsAndKeys: @"", @"FirstValue", @"", @"SecondValue", nil] forKey: @"Languages"]; [newDict setObject: @"" forKey: @"Notes"]; for(i=0;i<[oldDict count];i++) { tempDict = [NSMutableDictionary dictionaryWithObjectsAndKeys: [fvArray objectAtIndex: i], @"FirstValue", [svArray objectAtIndex: i], @"SecondValue", nil]; [words addObject: tempDict]; } [newDict setObject: words forKey: @"Words"]; [newDict writeToFile: nfname atomically: YES]; [pool release]; exit(1); }