I want to find common line in two files and replace the next line of first file with the next line of second file. (sed,awk,perl,bash any solution is welcomed ) Case Ignored. Multiple Occurrence of same line.
That would work fine ,if file1 content and file2 contents are different... but it is not working if contents are same only ^msgstr.*$ line is different.. for example..it wont work if my contents are something like this:
On the first line file 2 differs by 1 space, so there is no match on that line. Also there is an extra line in file1 dhshfjksdfhmd that matches and so the answer is msgid "vidya" and therefore msgid "Vidya" will not get looked up.
I guess it comes down to:
is there a format to the file?
if so, what is it?
if so, do these files conform to that format?
if so, what would you like to do in the case above?