I'm having trouble parsing what should be something simple.
I have an input file with lines like this:
domain1.com
domain2.net
domain4.com
...
etc.
So usually there are 2 lines per record, but sometimes there will be just 1.
The desired output is:
domain1.com domain2.net domain4.com
I managed to get some output using this:
$1 !~ /http/{domain = $1}
/http/{destination = $1; printf ("%-50s %-50s\n", domain, destination)}
But I'm not sure that it's the most accurate/efficient method. I can't recall the best combination of ORS/OFS/IFS/IRS to use to achieve what I'm looking for.
Any help would be appreciated.
Thanks,
John
I have an input file with lines like this:
domain1.com
domain2.net
domain4.com
...
etc.
So usually there are 2 lines per record, but sometimes there will be just 1.
The desired output is:
domain1.com domain2.net domain4.com
I managed to get some output using this:
$1 !~ /http/{domain = $1}
/http/{destination = $1; printf ("%-50s %-50s\n", domain, destination)}
But I'm not sure that it's the most accurate/efficient method. I can't recall the best combination of ORS/OFS/IFS/IRS to use to achieve what I'm looking for.
Any help would be appreciated.
Thanks,
John