I have the file1 with the following content
{"name":"clio5", "value":"13"}
{"name":"citroen_c4", "value":"23"}
{"name":"citroen_c3", "value":"12"}
{"name":"golf4", "value":"16"}
{"name":"golf3", "value":"8"}
And I have the file2 with the following content
{"name":"clio5", "value":"14"}
{"name":"citroen_c4", "value":"25"}
{"name":"golf4", "value":"18"}
I want to execute a shell command in order to display the content of the file1 and the file2. if a name
exist in both file1 and file2 so I want to display only the related line of the file2.
So the output should look like this:
$command taking account file1 file2
{"name":"clio5", "value":"14"}
{"name":"citroen_c4", "value":"25"}
{"name":"citroen_c3", "value":"12"}
{"name":"golf4", "value":"18"}
{"name":"golf3", "value":"8"}
The command should not edit file1 neither file2
The command should be as simple as possible
The command could contains grep
, sed
, awk
uniq
would do fine, but this appears to be more than that.