AWK - why fields go to seperate lines?
Doing a homework and when i write this every field goes different lines in the output? How can i fix it?
awk -F"%" '{ for (i=1; i< $3; i++){ print $i }}' text.txt man%boy%girl joe%jack%johnny to man boy girl joe jack johnny i want: man boy girl joe jack johnny i left 3 hours please be quick :) |
I don't do homework for others, but I will point out that the default behavior of print is to append a newline. On the other hand, printf() does not.
--- rod. |
Thanks very much!!
solved! By the way: it is the smallest part of hw and i spent 2 hours for adding "f" to print :) |
All times are GMT -5. The time now is 06:33 PM. |