use meld / xxdiff / or something else?
say if I have two yaml files, how can I merge them automatically? each of them has a few hundred lines. the common part is abc:
abc:
x:
0: null
y:
1: null
def:
x:
0: string
...
and
abc:
u: null
v: null
w: null
def:
u:
0: null
v: null
w: null
...
desired result:
abc:
x:
0: null
y:
1: null
u: null
v: null
w: null
def:
x:
0: string
u:
0: null
v: null
w: null
can this be done with any diff/merge tools?
edit: fixed typo in desired result
def
a common part, too? Do you really want to mergeabc
but have different entries fordef
? – morxa Mar 1 '16 at 5:23abc
key's values be merged and thedef
key's value not? First position? The actual name? What would happen ifabc
was afterdef
in the second file? Are your input files really such simplistic subset of YAML, e.g no comments between mapping entries, no anchors? – Anthon Mar 1 '16 at 5:24