Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

1
  • 1
    Your updated code above is sound, although uniquely tailored to your two input file format. You could perhaps simplify it a bit, but it is more a matter of style. The last test could be written: lineA3 != lineB3 && {printf "%s\n%", lineB1,lineB2,lineB3,lineB4} As you can see the if (...) construct is implicit and the printf method uses the same format and applies it to any input fed to it until exhausted. --- Steeldriver's array-based code is fine of course, although more complex. Commented Mar 17, 2019 at 9:15