Let's say I have a file that looks like:
what I want is an easy way to get
host1lx host2lx host1win host2win host3win host4win
Is there a neat way to automate that process?
Edit: What I was hoping for is something like using a substitution on
host[1-4]win using the line number, where I can repeat the replacement using the
[1-4] part. Imagine something like
But is there a way to not spell out the four hosts, instead have sed repeat it based on what was found in the