unix bash: separating a specific column into multiple columns -


I have a tab delimited file with three columns, in each column in the third column, there is a string with 4 names, each Is separated from space (''), but in some cases more than one place is separated between names. I want to use a Unix-Bash command line to print all the columns divided by tab 1, column 2, name 1, name 2, name 3, name 4, name 5, tab.

My intended output will look like this:

  avov2323 [tab] rogoc232 [tab] roy [tab] don [tab] mike [tab] ned [tab] Cdso3432 [tab] fokfd543 [Tab] Tom [Tab] Gill [Tab] Rose [Tab] Dan [Tab] Sam   
  • Is there a way to store all of my column 3 Is this specific variable divided based on a variable and after the empty space? Something like this: a = awk -F "\ t" '{print $ 3}' file.txt ; awk -F "" '{print $ 1}' $ a;

    However - this command line does not work for me ... because all the names in column 3 $ $ fed each other in $$

    Use tr to translate: < pre> tr & lt; Input file "" \ t "| Trends "\ t" & gt; Output file

    Edit: As Glenn Jackman told, first it would be better to squeeze the spaces, then the remaining spaces will change the tab.

      tr & lt; InputFile -s "" | Tr "" "\ t" & gt; Output file   

    However for the first two columns it is still weak for the empty space.

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -