How to print columns of database using forloops in awk?

You need to remove the for loop. Awk does that automatically.

Up vote 1 down vote favorite share g+ share fb share tw.

Hello every one I have just started learning awk and I am facing a problem here is my data james 31 mary 22 john 28 I want to print some thing like this "mary age is 22 "using for loop I have written this code { for (i=1 ;i.

You need to remove the for loop. Awk does that automatically. Given the file called names: james,31 mary,22 john,28 You just need to do this on the command line: awk -F ',' 'FNR == 2 {print $1 " age is " $2}' names This will give mary age is 22.

You don't have to do complex logic for that. See this example: kent$ echo " james 31 dquote> mary 22 dquote> john 28 dquote> "|awk 'BEGIN{OFS=" age is "}$1=$1' james age is 31 mary age is 22 john age is 28.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions