Search Results

Search: Posts Made By: pmennen
2,840
Posted By Scrutinizer
Another option: sed -n 's/key[12]: //p' file |...
Another option:
sed -n 's/key[12]: //p' file | paste -d" " - -


--
( or sed -n 's/key[12]: \(...\)/\1/p' file | paste -d" " - - if you will )


---

That will not work since even in GNU...
2,840
Posted By neutronscott
This at least works in GNU sed ...
This at least works in GNU sed


mute@tiny:~$ sed -n '/key1:/{s/key1: //;h};/^key2:/{H;x;s/\nkey2://p}' input
ABC DEF
GGG HHH


Place it in hold space. Append key2 to hold space, swap...
Showing results 1 to 2 of 2

 
All times are GMT -4. The time now is 03:24 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy