I have a tab delimited file with three columns. Each of the row in the 3rd column holds a string that has 4 names, each separated from the other by space (' '), but in some cases there are more than one space separated between the names. I'd like to use a unix-bash command line to print column 1, column 2, name1, name2, name3, name4, name5, all separated by tab.
My desired output would look like this:
avov2323[tab]rogoc232[tab]Roy[tab]Don[tab]Mike[tab]Ned[tab]Lee
cdso3432[tab]fokfd543[tab]Tom[tab]Gil[tab]Rose[tab]Dan[tab]Sam
- Is there a way to store all my column 3 into a variable and then split this specific variable based on spaces?
something like:
a=
awk -F "\t" '{print $3}' file.txt;awk -F " " '{print $1}' $a;
although - this command line doesn't work for me... as all the names from column 3 get cramped to each other in $a.