How to merge two arrays in a plist? - iphone

I have a plist with two string arrays. I want to merge these two arrays. I tried selecting all the strings in one array and copying to the other, but I cant select multiple items. I don't want to do this programmatically. I'm on a Mac using xcode. Any thoughts?

Just edit the PList files as text (context menu, "Open as plain text file" or "Source code file") and copy the relevant items in.

Save the plist in XML format if it isn't already, then open it as text. If you understand XML, it's pretty straightforward to move all the string nodes from one array to the other, then just remove the unwanted array node.

Related

Trying to drop the contents of one Word document into another

This is in an IDTExtensibility2 (not VSTO) Word AddIn. I'm trying to do a drag drop where I programatically give the contents of one document to DoDragDrop(). The problem is instead of dropping the contents in the other document, it inserts it as an embedded Word document.
My code is basically:
srcDoc.Activate();
activeWindow = srcDoc.ActiveWindow;
selection = activeWindow.Selection;
selection.WholeStory();
selection.Copy();
data = Clipboard.GetDataObject();
DragDropEffects effect = DoDragDrop(data, DragDropEffects.Copy | DragDropEffects.Scroll);
How can I have it paste the contents instead of pasting the document?
Please note, I want to paste all of the content in the source document into the insertion point of the drop in the destination object. So it's not copy over the full contents of the destination (therefore a file based approach won't work).
And it's drag/drop so I don't have the control that Clipboard.Paste() provides to specify the pasting format. In addition, the format I need is the native DOCX format to bring all properties & formatting across.
thanks - dave

Is it possible to attach two word file with each other?

Like in MS Excel one csv file may contain more than one sheet, Like this what I have to do is I want to keep all the theory in one word file and the programs in another word file. But I want to attach these both file with each other as a single DOC file.
Like a single DOC file contain theory as well as programs, which is open as two separate content/file.
Something close to what you want to do is the following:
In new Word Document Select your "View" Tab and then Select "Outline View".
Then Select "Show Document". The "Insert Button will now be visible.
You can now insert various documents in this document.
Unfortunately as far as I know this will have links into the original Documents which you can then open, edit and access from the new document.
Try it out and let me know!
Also, you can maybe try Microsoft One Note, I think this is probably what you looking for. See partial screen shot below for an idea.

Grouping two files into one custom file-type

I am currently working on a simple tower defense game for iOS (using objective-c), which contains several maps/levels. However, as it is now, each map consists of an image file and a .plist file with information. My question is: is there any way I could create a custom file type (for example, *.map) that contains both the image and the information from the plist?
If this is possible, how do I implement this?
Thanks in advance!
You have several good choices for that:
The simplest solution would be grouping the related files in subfolders: rather than having xyz.map file, you could have an xyz sub-folder, and reference the files out of it. You would not need to use any additional libraries for this, and you would be able to use the same name for all your image files and all your level files, because they would be in separate folders.
You can make a zip archive with the files that you would like to combine, and unzip it before use. Here is a link to an answer referencing a library to do it.
You can use a tar format - here is a list to an answer referencing a library that supports it. You would be able to use tar utility on OS-X to group images with plists on your workstation.
Finally, you can define a format of your own: store the length of the first file in the first four bytes, then store the content of the first file, and then the second. You would need to write a utility for combining the two files into one. This sounds like the hardest choice to implement.

C# folder and subfolder

Upon numerous searches, I am here to see if someone has any idea on how I should go about tackling this issue.
I have a folder with sub-folders. The sub-folder containers each has files of different file types e.g. pdf, png, jpeg, tiff, avi and word documents.
My goal is to write a code in C# that will go into the subfolder, and combined all the files into one pdf using the name of the folder. The only exception is that a file such as avi will not be pdf'ed in which case I want a nudge as to which folder it is and possibly file name. I am trying to use the form approach, so that you can copy in the folder pathname and also destination of the created pdf.
Thanks.
to start, create a FolderBrowserDialog to get the root folder. Alternatively just make a textbox in which you paste the folder name ( less preferred since the first method gives you nicer error-handling straight out of the box )
In order to iterate through, see How to: Iterate Through a Directory Tree
To find the filetype, check System.IO.FileInfo.Extension for each file you iterate through. Add those to list with the data you need. ( hint, create a list of objects in which your object reflects the data you need such as path, type etc,... ). If its an avi don't toss it in the list but flash a warning (messagebox?) instead.
From here the original question gets fuzzy. What exactly do you need in the pdf. Just the filenames and locations or do you actually want to throw the actual contents of the file in pdf?

Best way to spell check a plist?

I've got about 400 different NSString entries in my plist file. I want to spell check them. At the moment I'm having to go through, expand each entry (there's a huge amount) and select the text then do a spell check (Cmd + ;).
I really need to spell check the whole thing at once, like you would in a word document, or an excel spreadsheet. I don't mind having to manually filter out the occasional field I don't need changing. It would be quicker that way, than having to go through and select all the different strings separately.
Is there anything I can do? Or am I doing it the best way already?
Thanks
Tom
In Xcode, right-click on the file you want to spellcheck. Select "Open as->Plain text file".
From there, you should be able to spellcheck the whole plist.