I have a file that looks like this (columns are separated by tabs):
Owner Phone Car
Dan 111-111-1111 Avalon Camry
Stacy 222-222-2222 Corolla Yaris Camry
Henry 333-333-3333 Prius
I want all additional cars to be on their own line below the original (with the owner and phone information copied for each additional car) so that it looks like this:
Owner Phone Car
Dan 111-111-1111 Avalon
Dan 111-111-1111 Camry
Stacy 222-222-2222 Corolla
Stacy 222-222-2222 Yaris
Stacy 222-222-2222 Camry
Henry 333-333-3333 Prius
I was wondering if there is a way to implement this using awk or sed (preferably one liner).
source
share