Welcome to the Linux Foundation Forum!

AWK - split lines

Options

Hey Guys,

Does anyone know how can I "split" the lines bellow (it is just an example):

mercedes|$40000|black|$42000|white|$41000|red
audi|$31000|blue|$10000|white
mercedes|$5000|blue

The output I expect is:

mercedes|$40000|black
mercedes|$42000|white
mercedes|$41000|red
audi|$31000|blue
audi|$10000|white
mercedes|$5000|blue

I am trying to figure out how to do it using awk but i couldn't

Thanks

Categories

Upcoming Training