dessie1981
Programmer
Hi everyone,
Im quite new to awk and i am having a problem parsing a txt file.
The problem is that i have a number of different columns seperated by tabs yet some of the columns have spaces in them, awk is seeing the spaces as a seperator also
I am running awk from the command line
e.g.
myfile.txt
tab1 tab2 tab3 tab4 tab4 tab4
cat myfile.txt|awk '{print $4}'
will return only "tab4"
How do i get awk to return "tab4 tab4 tab4"
i have also tried
cat myfile.txt|awk '{FS = "/t"}{print $4}'
But it just returns blanks.
Any help would be greatful.
Regards
Des
Im quite new to awk and i am having a problem parsing a txt file.
The problem is that i have a number of different columns seperated by tabs yet some of the columns have spaces in them, awk is seeing the spaces as a seperator also
I am running awk from the command line
e.g.
myfile.txt
tab1 tab2 tab3 tab4 tab4 tab4
cat myfile.txt|awk '{print $4}'
will return only "tab4"
How do i get awk to return "tab4 tab4 tab4"
i have also tried
cat myfile.txt|awk '{FS = "/t"}{print $4}'
But it just returns blanks.
Any help would be greatful.
Regards
Des