I have a set of files containing data that I need to re-arrange into one single property list.
The files that I have look like this:
Code:
# cat uk
<string>10</string>
<string>11</string>
...
<string>29</string>
# cat us
<string>A</string>
<string>B</string>
...
<string>R</string>
# cat eu
<string>6</string>
<string>7</string>
...
<string>25</string>
I've 6 of these files in total. What I need is a property list like this:
Code:
<array>
<dict>
<key>uk</key>
<string>10</string>
<key>us</key>
<string>A</string>
<key>eu</key>
<string>6</string>
</dict>
<dict>
<key>uk</key>
<string>11</string>
<key>us</key>
<string>B</string>
<key>eu</key>
<string>7</string>
</dict>
...
<dict>
<key>uk</key>
<string>29</string>
<key>us</key>
<string>R</string>
<key>eu</key>
<string>25</string>
</dict>
</array>
So the lines in the files match up but I haven't found a way of reading several files line by line. What would be the best way to go about this?