As a newbie to UNIX, I need help!I want to split a text into rows and print its value, for example, change this:YLB; YLR; YLS (tab) 30Into this:YLB (tab) 30YLR (tab) 30YLS (tab) 30
How do I split text into rows and print its corresponding value?
split
Using awkawk 'BEGIN {FS=[; \t]+; OFS=\t} {for (i=1; i<NF; i++) print $i, $NF}'Ex.$ echo 'YLB; YLR; YLS     30' | awk 'BEGIN {FS=[; \t]+; OFS=\t} {for (i=1; i<NF; i++) print $i, $NF}'YLB     30YLR     30YLS     30