Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to merge multiple plist files into one?

Tags:

ios

plist

Just to start, I really have no idea what Im doing. I was given this task for an internship, and am really learning as I go. I have multiple plist files, they consist of around 22 items each, and list values of colors. I need to merge all of these files into one, and am really not sure how to go about it. I have a certain structure I need to go by, and really Im not sure how to go about it. I was told to open the plists in texteditor and then paste all of the raw code into one text file, this doesn't seem to work as I only end up getting the values for the first plist I pasted into the text file. Any help would be nice. Thanks.

like image 507
thatsnifty Avatar asked Nov 29 '22 09:11

thatsnifty


1 Answers

Assume your from.plist contains keys 1, 2 and to.plist contains 2, 3

Run this:

/usr/libexec/PlistBuddy -x -c "Merge from.plist" to.plist

to.plist will contain 1, 2, 3

like image 57
artyom.razinov Avatar answered Dec 05 '22 14:12

artyom.razinov