In my input file, columns are tab-separated, and the values inside each column are comma-separated.
I want to print the first column with each comma separated value from the second.
Mary,Tom,David cat,dog
Kevin bird,rabbit
John cat,bird
...
for each record in the second column ( eg
cat,dog
) i want to split record into array of [ cat, dog ] and cross print this against the first column. giving output ( just for this line )Mary,Tom,David cat Mary,Tom,David dog
output for whole file should be be:
Mary,Tom,David cat
Mary,Tom,David dog
Kevin bird
Kevin rabbit
John cat
John bird
...
any suggest if i want to use awk or sed? Thanks
\t
to\n
and,
to\t
or several spaces? - Yaron